Published in: HTML
This is a generic template for an XHMTL 1.1 doc that I start with at the beginning of every project.
Then i setup the directories to match. I use @import for CSS, then a seperate CSS file for screen-specific, and then one for print.
I have the basic DIV structure setup, too.
Hope it helps!
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>title goes here</title> <base href="base url goes here" /> <meta name="Author" content="#" /> <meta name="Robots" content="#" /> <meta name="Generator" content="#" /> <meta name="Keywords" content="#" /> <meta http-equiv="Expires" content="#" /> <meta name="Description" content="#" /> <meta name="Copyright" content="#" /> <meta http-equiv="Cache-Control" content="#" /> <link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" /> <link href="/script/javascript.js" type="text/javascript" /> <style type="text/css" xml:space="preserve"> /*<![CDATA[*/ @import url(/css/style.css) all; /*]]>*/ </style> <link rel="stylesheet" href="/css/screen.css" type="text/css" media="screen" /> <link rel="stylesheet" href="/css/print.css" type="text/css" media="print" /> </head> <div id="container"> <div id="header"> <h1>Title of page goes here</h1> <h2>Subtitle of page goes here</h2> <h3>Skip to content</h3> </div><!-- end header div --> <div id="nav"> </ul> <ul id="breadcrumbs"> </ul> </div><!-- end nav div --> <div id="main"> <h3>Title of article goes here?</h3> <p>Begin article here</p> <ul id="sidebar"> </ul> </div><!-- end main div --> <div id="footer"> <p>©2XXX company name here. Creative Commons link/ your own link</p> </div><!-- end footer div --> </div><!-- end container div --> </body> </html>
Comments
Subscribe to comments
You need to login to post a comment.

don't put this above it
<?xml version="1.0" encoding="utf-8"?>
you should test your code before posting it.
putting this
above the the doctype moves the doctype down one line and throws internet explorer into the quirks mode. if you are going to operate in the quirks mode why bother to use a doctype in the first place?
Nice enough idea in principle... the only caveat I would raise is the use of the XHTML 1.1 variant. This DOCTYPE is intended as the foundation upon which to build compound document formats (XHTML + MathML + SVG + etc).
You should really be using XHTML 1.0 Strict.
Given proper conformance to the XHMTL standard and modular inclusion of the DOCTYPE across a site then upgrading to XHTML 1.1 ought to be simple.
Hope that helps
There are issues with this template that users should know about. Using the xml prolog (
There are issues with this template that users should know about. Using the xml prolog (
Looks like the copyright symbol doesn't read correctly in W3C's validator. Otherwise it was completely valid for me!
Mmmk, for some reason the code isn't showing, so let's try without tags:
Current: link href="/script/javascript.css" Suggested: link href="/script/javascript.js"
I think there's a typo at line 18: Wouldn't be better something like:
I mean just to be consistent with extension naming conventions. Anyway it's a great template, thanks for sharing!