XHTML 严格的XHTML示例

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>simple document</title>
</head>
<body>
<p>a simple paragraph</p>
</body>
</html>

XHTML XHTML 1.0严格框架

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<title>XHTML</title>
</head>
<body>
<div class="wrap">
	<div class="header">
		
	</div>
	<div class="main">
		<div class="content">
			
		</div>
		<div class="sidebar">
			
		</div>
	</div>
	<div class="clearer"></div>
	<div class="footer">
		
	</div>
</div>
</body>
</html>

XHTML 让IE 8像IE 7一样运行

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

XHTML 隐私政策

<h1>Privacy Policy</h1>
<div class="toc">
  <ul>
      <li><a href="#1">Our Commitment To Privacy</a></li>
      <li><a href="#2">The Information We Collect</a></li>
      <li><a href="#3">How We Use Information</a></li>
      <li><a href="#4">Our Commitment To Data Security</a></li>
      <li><a href="#5">Our Commitment To Children's Privacy</a></li>
      <li><a href="#6">How To Access Or Correct Your Information</a></li>
      <li><a href="#7">How To Contact Us</a><br />
  </ul> 
</div>
<h2><a name="1"></a>Our Commitment To Privacy</h2>
<p>Your privacy is important to us. To better protect your privacy we provide this notice explaining our online information practices and the choices you can make about the way your information is collected and used. To make this notice easy to find, we make it available on our homepage and at every point where personally identifiable information may be requested.</p>

<h2><a name="2"></a>The Information We Collect</h2>
<p>This notice applies to all information collected or submitted on the [company name] website. On some pages, you can order products, make requests, and register to receive materials. The types of personal information collected at these pages are:</p>                   
<ul>
   <li>Name</li>
   <li>Address</li>
   <li>Email address</li>
   <li>Phone number</li>
   <li>Credit/Debit Card Information</li>
   <li>(etc.)</li>
</ul>
<p>On some pages, you can submit information about other people. For example, if you order a gift online and want it sent directly to the recipient, you will need to submit the recipient's address. In this circumstance, the types of personal information collected are:</p>
<ul>
   <li>Name</li>
   <li>Address</li>
   <li>Phone Number</li>
   <li>(etc.)</li>
</ul>

<h2><a name="3"></a>The Way We Use Information</h2>
<p>We use the information you provide about yourself when placing an order only to complete that order. We do not share this information with outside parties except to the extent necessary to complete that order.</p>
<p>We use the information you provide about someone else when placing an order only to ship the product and to confirm delivery. We do not share this information with outside parties except to the extent necessary to complete that order.</p>
<p>We offer gift-cards by which you can personalize a product you order for another person. Information you provide to us to create a gift-card is only used for that purpose, and it is only disclosed to the person receiving the gift.</p>
<p>We use return email addresses to answer the email we receive. Such addresses are not used for any other purpose and are not shared with outside parties.</p>
<p>You can register with our website if you would like to receive our catalog as well as updates on our new products and services. Information you submit on our website will not be used for this purpose unless you fill out the registration form.</p>
<p>We use non-identifying and aggregate information to better design our website and to share with advertisers. For example, we may tell an advertiser that X number of individuals visited a certain area on our website, or that Y number of men and Z number of women filled out our registration form, but we would not disclose anything that could be used to identify those individuals.</p>
<p>Finally, we never use or share the personally identifiable information provided to us online in ways unrelated to the ones described above without also providing you an opportunity to opt-out or otherwise prohibit such unrelated uses.</p>

<h2><a name="4"></a>Our Commitment To Data Security</h2>
<p>To prevent unauthorized access, maintain data accuracy, and ensure the correct use of information, we have put in place appropriate physical, electronic, and managerial procedures to safeguard and secure the information we collect online.</p>

<h2><a name="5"></a>Our Commitment To Children's Privacy</h2>
<p>Protecting the privacy of the very young is especially important. For that reason, we never collect or maintain information at our website from those we actually know are under 13, and no part of our website is structured to attract anyone under 13.</p>

<h2><a name="6"></a>How You Can Access Or Correct Your Information</h2>
<p>You can access all your personally identifiable information that we collect online and maintain by [description of the company access procedure]. We use this procedure to better safeguard your information.</p>
<p>You can correct factual errors in your personally identifiable information by sending us a request that credibly shows error.</p>
<p>To protect your privacy and security, we will also take reasonable steps to verify your identity before granting access or making corrections.</p>

<h2><a name="7"></a>How To Contact Us</h2>
<p>Should you have other questions or concerns about these privacy policies, please call us at [phone number] or send us an email at [email address].</p>

XHTML XHTML中的有效JS

<script type="text/javascript">   
// <![CDATA[   

// ]]>   
</script>

XHTML XHTML 1.0严格新文档(双列)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

	<title>New Doc</title>

	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<meta http-equiv="imagetoolbar" content="no" />
	<!-- / Meta -->

	<link rel="stylesheet" type="text/css" href="css/base.css" />
	<!-- / Stylesheet resources -->

	<script type="text/javascript" src="js/common.js"></script>
	<!-- / JavaScript resources -->

	<link rel="Shortcut Icon" href="imgs/favicon.ico" type="image/x-icon" />
	<!-- / Other resources -->
	
</head>
<body>

	<div id="jacket">
		
		<div id="header">
			<h1>headline 1</h1>
		</div>
		<!-- / header -->
		
		<div id="nav">
			<ul>
				<li><a href="#">nav 1</a></li>
				<li><a href="#">nav 2</a></li>
			</ul>
		</div>
		<!-- / nav -->
		
		<div id="container">
			
			<div id="content">
				<h2>headline 2</h2>
				<p>body 1 para <a href="#" rel="external" title="#">external link</a></p>
				<h3>headline 3</h3>
				<img src="#" alt="" />
				<h4>headline 4</h4>
			</div>
			<!-- / content -->
			
			<div id="sidebar">
				<h5>headline side 1</h5>
				<p>para para</p>
				<ul>
					<li>list 1</li>
				</ul>
			</div>
			<!-- / sidebar -->
			
		</div>
		<!-- / container -->
		
		<div id="feets">
			<p>Copyright © 2009.</p>
		</div>
		<!-- / feets -->
		
	</div>
	<!-- / jacket (wrapper) -->

</body>
</html>

XHTML 使用jQuery和Dean Edwards的IE7-js的XHTML 1.0 Strict Template Skeleton

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head>
  <title>PageTitle</title>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <meta name="description" content="" />
  <link rel="stylesheet" href="screen.css" type="text/css" media="screen,projection,tv" />
  <link rel="stylesheet" href="print.css" type="text/css" media="print" />
  <!--[if lt IE 7]>
    <link rel="stylesheet" href="ie6.css" type="text/css" media="screen,projection,tv" />
    <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js" type="text/javascript"></script>
  <![endif]-->
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
</head> 
<body id="" class="">  
  <h1>PageTitle</h1>
  
</body>
</html>

XHTML XHTML + RDFa 1.0模板(作为XHTML + XML,jQuery和Y!CSS重置)

<?php 
header( 'Content-type: application/xhtml+xml' );
$xmldec = 	"<?xml version="1.0" encoding="utf-8"?>\n";
$xmldec .= 	"<?xml-stylesheet type="text/xsl" href="ie-xml-fix.xsl"?>\n";
echo html_entity_decode( $xmldec );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd" [
	<!ATTLIST img longdesc CDATA #IMPLIED>
]>
<html version="XHTML+RDFa 1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/terms/" xmlns:xhv="http://www.w3.org/1999/xhtml/vocab#" xmlns:media="http://purl.org/media#" xmlns:commerce="http://purl.org/commerce#" xmlns:audio="http://purl.org/media/audio#" xml:lang="en" lang="en">

	<head>
		<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=utf-8" />

		<!-- Site & Page URL Meta -->
		<base href="#" />
		<link rel="canonical" href="#" />
		
		<!-- Caching Meta -->
		<meta http-equiv="expires" content="#" />
		<meta http-equiv="cache-control" content="#" />
		
		<!-- Language Meta -->
		<meta name="content-language" content="#" />
		<meta name="language" content="#" />

		<!-- Production Meta -->
		<meta name="author" content="" />
		<meta name="designer" content="" />
		<meta name="copyright" content="(c) YYYY. All Rights Reserved." />

		<!-- Site || Page Meta -->
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		
		<!-- Search Engine Meta -->
		<meta name="robots" content="noydir,noodp,nosnippet" />
		<meta name="googlebot" content="" />
		<meta name="msnbot" content="" />
		<meta name="slurp" content="" />
		
		<title>New XHTML + RDFa Document</title>

		<!-- JavaScript Resources -->
		<!--[if lt IE 8]>
		<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
		<![endif]-->
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

		<!-- Style Resources -->
		<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css" type="text/css" media="screen" />
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	</head>
	<body>
		<h1>XHTML + RDFa!</h1>
		<p property="dc:created" content="YYYY-MM-DD">I am an XHTML document, extended by RDFa. Hello, world!</p>
		<p about="" resource="http://www.w3.org/TR/rdfa-syntax" rel="dct:conformsTo" xmlns:dc="http://purl.org/dc/terms/"><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml-rdfa-blue" alt="Valid XHTML + RDFa" longdesc="http://validator.w3.org/" /></a></p>
	</body>
</html>

XHTML XHTML 1.0模板 - 标题 - 内容 - 模块 - 页脚

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<title></title>
	<link rel="stylesheet" href="reset.css" type="text/css" />
	<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>

	<div id="wrapper">
	
		<div id="header">
			
			<div id="nav">
				<ul>
					<li><a href="#">Home</a></li>
					<li><a href="#">Products</a></li>
					<li><a href="#">About</a></li>
				</ul>
			</div>
			
		</div><!-- END header -->
	
	
		<div id="contentWrapper">
		
			<div id="content">
				<h1>Here goes the title<h1>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat pretium congue. Etiam tincidunt, arcu ut tempus molestie, massa felis molestie ipsum, eu dictum nibh tellus id mauris. Nunc ac enim augue. Vestibulum aliquet viverra arcu in vehicula. Integer convallis metus nec augue commodo porta tristique sapien malesuada. Aenean molestie ornare consequat. Ut lacinia nisi ut leo ultrices eu adipiscing nibh interdum. Ut ac diam id lorem tempor sollicitudin. Nulla et ligula at tortor mattis scelerisque. Maecenas eget neque eget leo viverra pulvinar. Maecenas ut justo enim, ac suscipit mi. Nam vel eros sit amet orci laoreet fringilla. Nunc posuere urna eu libero ultrices varius. Integer ultricies suscipit tristique. Mauris consequat fringilla nibh eget tristique.</p>
			</div><!-- END content -->
			
			<div id="modules">
				
				<div class="moduleWrapper">
					<div id="moduleHeader">
						<h2>Module Title</h2>
					</div><!-- END moduleHeader -->
					<div id="moduleContent">
					
						<!-- #### MODULE CONTENT HERE #### -->
						
					</div><!-- END MODULECONTENT -->
				</div><!-- END moduleWrapper -->
				
			</div><!-- END modules -->
			
		</div><!-- END CONTENTWRAPPER -->
	
	
		<div id="footerWrapper">
			<div id="footer">
			</div><!-- END FOOTER -->
		</div><!-- END FOOTERWRAPPER -->
		
	</div><!-- END WRAPPER -->

</body>
</html>

XHTML JQuery 1.3.2 Google Include

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">

$(function() {

// Ready to code...

});

</script>