HTML and CSS Reference
<audio src="audio.webm" controls></audio>
You can download the example code files for all Packt topics you have pur-
book elsewhere, you can visit http://www.PacktPub.com/support and register to
have the files e-mailed directly to you.
Deciding which element to use
With HTML5, we have a glut of elements to choose from, causing choice paralysis
for some of us. If there is anything in the structure of your document that seems to
very obviously fit any of the new elements, go ahead and mark them so. If they don't,
continue using div or any other element that seems to obviously fit.
In our code, we use the section element when we have primary content that is
structurally different and the article element for which we have similar, but repeat-
ing sections of content. Your views on these choices may well be different; in which
case, I recommend you choose what you are comfortable with.
If you wish to know more about the new HTML5 elements, I recommend you check
out the chapter on semantics in HTML5: Up & Running, Mark Pilgrim, O'Reilly , under
the Google Press imprint, at diveintohtml5.info/semantics.html .
Writing valid markup
Writing valid markup ensures your page behaves consistently across all browsers
that render it. Valid markup refers to markup that adheres to the Web standards that
browsers comply with. This way, you will prevent any unpredictable behavior.
The easiest way to write valid markup is to use tools that validate it instantly as and
when you save your file.