HOME

Teaching Online Journalism

Tips for HTML5, part 2

Continuing on with the meaty third chapter of Dive into HTML5, I’m delighted to see that we can still represent the structure of a page to HTML beginners this way:

<html>
<head>
<!-- meta data -->
</head>
<body>
<!-- document content -->
</body>
</html>

This essential structure will not change with HTML5.

There are two important bits (one in the HTML tag, and the other within the HEAD) that we need to include.

(1) Inside the HTML tag:

<html lang=”en”>

Many of us have been including a bunch of other stuff in there, as called for by XHTML 1.0. No more! That extra stuff is not to be included for HTML5.

If your language is not English, you’ll use something other than “en” (look it up).

(2) Enclosed by the HEAD tags:

<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />

Many of us have been including this for a long time, but I find a lot of people still not using the UTF-8 character set. (They are using the older ISO-8859-1, which is no longer correct.)

Alternatively, you could use this shorter version for HTML5:

<meta charset=”utf-8″ />

Sweet!

For related posts, check out the “code” category here in this blog.


Categories: design


One Comment

  1. [...] what runs the video on iPods/iPhones/iPads) – I'll be reading these in the next few days: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6. I'm not sure if she's finished with the series yet, so check for [...]

Leave a Reply