Skip to content

Instantly share code, notes, and snippets.

@chrisjacob
Created January 12, 2011 16:07
Show Gist options
  • Save chrisjacob/776355 to your computer and use it in GitHub Desktop.
Save chrisjacob/776355 to your computer and use it in GitHub Desktop.
XHTML5 using .xhtml and .html extensions
<!DOCTYPE html>
<!-- See http://mathiasbynens.be/notes/xhtml5 for more info. -->
<!-- This document is served as application/xhtml+xml to trigger HTML5 in XML serialization mode. -->
<!-- The DOCTYPE is optional in XML mode, but if you don't want to omit it, it needs to be uppercase. -->
<!-- Also, you need to add an XML namespace to the root element. -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>XHTML5, or HTML5 in XML serialization mode</title>
</head>
<body>
<p><a href="http://html5.validator.nu/?doc=http://mathiasbynens.be/demo/xhtml5">Valid XHTML5</a>!</p>
</body>
</html>
<!DOCTYPE html>
<!-- See http://mathiasbynens.be/notes/xhtml5 for more info. -->
<!-- This document is served as application/xhtml+xml to trigger HTML5 in XML serialization mode. -->
<!-- The DOCTYPE is optional in XML mode, but if you don't want to omit it, it needs to be uppercase. -->
<!-- Also, you need to add an XML namespace to the root element. -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>XHTML5, or HTML5 in XML serialization mode</title>
</head>
<body>
<p><a href="http://html5.validator.nu/?doc=http://mathiasbynens.be/demo/xhtml5">Valid XHTML5</a>!</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment