XHTML5 Example
This example uses XHTML5 markup.
This <div> is green in all browsers.
This <section> is green, except in Internet Explorer.
This <html5:section> is green, even in Internet Explorer.
See the source of this example.
Don't forget
- To escape your colons with a backslash
Since this is XHTML5, also don't forget
- That clean code is paramount or you'll get parser errors
- The double namespace declaration in the 'html' element, one for the HTML5 elements and one for the rest
- The UPPERCASE doctype
- The serving as 'application/xhtml+xml' except for IE, since it wants 'text/html'
- The XML declaration that you don't serve to IE, since it can trigger quirks mode
Does this validate?
Yes! See: