Last active
November 17, 2024 02:20
-
-
Save waldyrious/9260278 to your computer and use it in GitHub Desktop.
Minimal XHTML5 document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Minimal XHTML5 document</title> | |
<link rel="stylesheet" href="mystyle.css" /> | |
<script src="myscript.js"></script> | |
</head> | |
<body> | |
<p> | |
This is a | |
<a href="https://mathiasbynens.be/notes/xhtml5">minimal</a> | |
<a href="https://blog.whatwg.org/xhtml5-in-a-nutshell">XHTML5</a> | |
<a href="https://www.w3.org/TR/html-polyglot/">document</a>. | |
</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For local/CI validation,
xmllint
can be used, though it requires specifying a DTD:I found that using
<meta charset="utf-8" />
as above results in the following output by xmllint:Using
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
does work, but both forms are spec-compliant so they should be accepted (and indeed the major web browsers do accept them).