HTML and CSS Reference
In-Depth Information
This is important as the word six, for example, is pronounced dif-
ferently depending on whether the language is English or French.
Also, as we'll see later, IE requires the <body> element before it
will apply CSS to style new HTML5 elements.
So, in the interest of maintainability, we'll add those optional
elements to make what's probably the minimum maintainable
HTML5 page:
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Interesting blog</title>
</head>
<body>
<p>Today I drank coffee for breakfast. 14 hours later,
¬ I went to bed.</p>
</body>
</html>
Does validation matter anymore?
Given that we have such forgiving syntax, we can miss out implied tags like <html> , <head> , and <body> ,
and—most importantly—because HTML5 defines a consistent DOM for any bad markup, you'll be forgiven
for asking yourself if validation actually matters any more. We've asked ourselves the same question.
Our opinion is that validation was always a tool, a means to an end—not a goal in itself.
The goal is semantic markup: ensuring that the elements you choose defi ne the meaning of your content
as closely as possible, and don't describe presentation. It's possible to have a perfectly valid page made
of nothing other than display tables, divs and spans, which is no semantic use to anyone, Conversely, a
single unencoded ampersand can make an excellently-structured semantically-rich web page invalid, but
it's still a semantic page.
We think that validation remains useful quality assurance, too. When we lead development teams, we
make passing validation a necessary step before any code review, let alone making code live. It's a great
way of ensuring that your code really does what you want. After all, browsers may make a consistent
DOM from bad markup but it might not be the DOM you want.
Also, HTML5 parsers don't exist yet in production browsers, so ensuring valid pages is absolutely what
you should aim for to ensure predictable CSS and JavaScript behaviours.
The validator we use is http://html5.validator.nu . We expect to see further developments in validators,
such as options to enforce coding choices—so you can choose to be warned for not using XHTML syntax,
for example, even though that's not required by the spec.
 
Search WWH ::




Custom Search