DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Barebones XHTML And CSS Template Pages

12.28.2005
| 5922 views |
  • submit to reddit
        Ok, so this guy already did this: http://www.bigbold.com/snippets/posts/show/583 but I needed a bit more.  So this is my xHTML template page (it doesn't declare xml since it makes IE kick out of standards mode):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>XHTML TEMPLATE</title>
  
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta name="description" content="THIS IS A TEMPLATE XHTML PAGE" />
  
  <link rel="stylesheet" href="main.css" type="text/css" media="screen" />
  
  <!-- <script type="text/javascript" src="prototype.js">
  </script> -->
  <script type="text/javascript" language="JavaScript"><!-- <![CDATA[
  // ]]> --></script>
</head>
<body>
  <div id="container">

  </div>
</body>
</html>

This is the accomponying CSS:

body {
  font-family :Verdana, Arial, Sans;
  font-size   :76%;
  margin      :0px; }
div#container {
  font-size   :1.0em; }

.clearfix:after {
    content: "."; 
    display: block; 
    height: 0; 
    clear: both; 
    visibility: hidden;
}

.clearfix {display: inline-table;}

/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */