HTML and CSS Reference
In-Depth Information
Do not use invented tags unless they are included via some other markup language:
<p> I <danger> shouldn't </danger> conform unless I am defined in
another specification and use a name space </p>
Encode special characters, particularly those used in tags ( < >) , either as an entity
of a named form, such as &lt; , or as a numeric value, such as &#60; . Appendix A
covers this topic in some depth.
This brief list of what you should do might seem familiar; it is pretty much the list of
recommendations for correct markup from the previous chapter returned to the traditional
markup styles of HTML. What this means is that if you have been writing markup correctly
in the past, HTML5 isn't going to present much of a change. In fact, in many cases, just by
changing a valid document's doctype to the new simple HTML5 <!DOCTYPE html> , the
result should be an HTML5-conforming document.
For those with a heavy investment in a strict XHTML syntax worldview, HTML5 might
seem like a slap in the face. However, such a reaction is a bit premature; HTML5 neither
makes the clean markup you write non-conforming nor suggests that you shouldn't author
markup this way. If you want to pursue an “XMLish” approach to your document, HTML5
allows it. Consider, for example, a strict XHTML example that is now HTML5:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="">
<title> Hello XHTML5 World </title>
<!-- Simple hello world in XHTML5 -->
<h1> Welcome to the World of XHTML5 </h1>
<hr />
<p> XHTML5 <em> really </em> isn't so hard either! </p>
<p> HTML5 likes XML syntax too .</p>
<p> Make sure to serve it with the correct MIME type! </p>
<!-- IE users you will get a render error.
Please read on to learn why. -->
N OTE When using XML syntax with HTML5 according to HTML5 specification, this should be
termed XHTML5.
Search WWH ::

Custom Search