Published in: XHTML
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, …yes, then one for IE. I have the basic DIV structure setup, too.
For a link to the inspiration of this template and further explanation (better), see this wonderful article: http://particletree.com/features/quick-start-your-design-with-xhtml-templates/ 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" dir="ltr"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <base href="" /> <meta name="Author" content="#" /> <meta name="Description" content="#" /> <meta name="Copyright" content="#" /> <meta name="Robots" content="#" /> <meta name="Generator" content="#" /> <meta name="Keywords" content="#" /> <meta http-equiv="Expires" content="#" /> <meta http-equiv="Cache-Control" content="#" /> <meta http-equiv="imagetoolbar" content="false" /> <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, projection" /> <link rel="stylesheet" href="/css/print.css" type="text/css" media="print" /> <!--[if IE]> <link rel="stylesheet" href="/css/win-ie-all.css" type="text/css" media="screen, projection" /> <![endif]--> </head> <body> <div id="container"> <div id="header"> </div><!-- end header div --> <div id="nav"> <ul> </ul> <ul id="breadcrumbs"> </ul> </div><!-- end nav div --> <div id="main"> <ul id="sidebar"> </ul> </div><!-- end main div --> <div id="footer"> </div><!-- end footer div --> </div><!-- end container div --> <!-- place google analytics here --> </body> </html>
Comments
Subscribe to comments
You need to login to post a comment.

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!
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"
Looks like the copyright symbol doesn't read correctly in W3C's validator. Otherwise it was completely valid for me!
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 (
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
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?
don't put this above it
<?xml version="1.0" encoding="utf-8"?>