O'Reilly logo

The Truth About HTML5 by RJ Owen, Luke Stevens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 2

image

The Truth About a Basic HTML5 Web Page

Let’s start with the first line of a web page. It’s now just this:

<!doctype html>

That’s it. It’s short, it’s memorable, and it triggers standards mode in all major browsers (including IE6). It’s also case insensitive. In HTML5 the opening <html> tag has also been simplified to <html lang="en">.

Browsers will cope without the lang attribute, but it’s good practice to specify the page’s primary language, especially for non-English pages. (See this helpful article on declaring languages in HTML5: http://nimbupani.com/declaring-languages-in-html-5.html.)

Next comes the <head> tag, which will contain ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required