Template.html

From XPUB & Lens-Based wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Simple

Template for a modern HTML5 page.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <title>Untitled</title>
  <link rel="stylesheet" href="style.css" />
</head>
<body>
<p>Hello world!</p>
</body>
</html>

The DOCTYPE is important to specify. When it's missing, many browsers (Internet Explorer in particular) will format the using "quirks mode" -- or using exceptions to modern CSS rules to support the historical (and deprecated) behavior of web browsers.

NB: When using in PHP, the character set cannot be set with the <?xml> tag -- as this kind of tag conflicts with the PHP parser.