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" xml:lang="en" lang="en" dir="ltr">
<head>
<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 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Page Title</title>
<link rel="stylesheet" href="site.css" type="text/css" />
<script src="jquery_version.js" type="text/javascript"></script>
</head>
<body>

</body>
</html>

XHTML 页面导航

<div class="pageNav">
		 	<b>pagini:</b>
			<ul class="menu">
				<li class="first"><a href="" title="">prima</a></li>
				<li class="inapoi"><a href="#" title="1">1</a></li>
				<li><a href="#" title="2">2</a></li>
				<li><a href="#" title="3">3</a></li>
				<li><span>...</span></li>
				<li><a href="#" title="1">4</a></li>
				<li><a href="#" title="2">5</a></li>
				<li class="inainte"><a href="#" title="3">6</a></li>
				<li class="last"><a href="" title="">ultima</a></li>
			</ul>
		</div><!--/pageNav-->

XHTML 垂直对齐定心

<style>
#floater{
	height:50%;
	margin-bottom:-207px;
}
#content{
	height:415px;
	position:relative;
	border:solid 1px red;
}
</style>

<div id="floater"></div>
 <div id="content">here content</div>

XHTML XHTML过渡源代码......

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title></title>
		
		<!-- meta tags -->
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		
		<!-- css references -->
		<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
		
		<!-- conditional css references -->
			<!--[if IE6]>
				<link rel="stylesheet" type="text/css" href="foldername/filename.css" media="screen" />
			<![endif]-->
			<!--[if IE7]>
				<link rel="stylesheet" type="text/css" href="foldername/filename.css" media="screen" />
			<![endif]-->
			
		<!-- linked client side-scripts -->
			<script type="text/javascript" src="js/filename.js"></script>
	</head>
	<body>
	
	</body>
</html>

XHTML 将图像置于框中(水平和垂直)居中

<style type="text/css">
.wraptocenter {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    width: ...;
    height: ...;
}
.wraptocenter * {
    vertical-align: middle;
}
/*\*//*/
.wraptocenter {
    display: block;
}
.wraptocenter span {
    display: inline-block;
    height: 100%;
    width: 1px;
}
/**/
</style>
<!--[if lt IE 8]><style>
.wraptocenter span {
    display: inline-block;
    height: 100%;
}
</style><![endif]-->
<div class="wraptocenter"><span></span><img src="..." alt="..."></div>

XHTML 分页XHTML / CSS

<style>
/*pagination*/
.pagination,
.pagination strong,
.pagination ul {
    float: left;
}
.pagination strong {
    font-size: 12px;
    color: #333333;
    margin: 0 20px 0 0;
    padding: 4px 0 0 0;
}
.pagination li {
    background: none;
    margin: 0;
    padding: 0;
}
.pagination a {
    color: #666666;
    font-size: 12px;
    padding: 4px 5px;
}
.pagination a:hover {
    color: #006699;
}
.pagination a.selected {
    color: #006699;
}
.pagination a.selected:hover {
    color: #006699
}
</style>

<div class="pagination">
	<strong>Pagini</strong>
	<ul class="menu">
		<li><a href="" title="1">1</a></li>
		<li><a href="" title="2">2</a></li>
		<li><a href="" title="3" class="selected">[ 3 ]</a></li>
		<li><a href="" title="4">4</a></li>
	</ul>
</div><!--/pagination-->

XHTML 在wordpress中创建空格

<br /> 

XHTML 联系PHP验证和HTML

< ?php
function hs($str) {
	return htmlspecialchars($str);
}
function clear_post() {
	$_POST['nome'] = $_POST['assunto'] = $_POST['email'] = $_POST['msg'] = null;
}

if (isset($_POST['enviar'])) {
	if (empty($_POST['nome'])
		or empty($_POST['assunto'])
		or !is_email($_POST['email'])
		or empty($_POST['msg'])
	) {
		$info = 'Preencha todos campos corretamente.';
	}

	else {
		$headers = 'From: ' . $_POST['email'] . "
" .
			'Reply-To: ' . $_POST['email']  . "
" .
			'X-Mailer: PHP/' . phpversion();

		if(@mail(get_bloginfo('admin_email'), $_POST['assunto'], $_POST['msg'], $headers)) {
			$info = 'E-mail enviado com sucesso.';
			clear_post();
		} else {
			$info = 'Erro no servidor.';
		}
	}
} else {
	clear_post();
}
?>


HTML>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


<form method="post" action="" class="contato">
		< ?php if (isset($info)) echo '<div class="info">' . $info . '
		<div>
			<label for="nome">* Nome</label><br />
			<input type="text" name="nome" value="<?php echo hs($_POST['nome']) ?/>" id="nome" />
		</div>
		<div>
			<label for="email">* E-mail</label><br />
			<input type="text" name="email" value="<?php echo hs($_POST['email']) ?/>" id="email" />
		</div>
		<div>
			<label for="assunto">* Assunto</label><br />
			<input type="text" name="assunto" value="<?php echo hs($_POST['assunto']) ?/>" id="assunto" />
		</div>
		<div>
			<label for="msg">* Mensagem</label><br />
			<textarea name="msg">< ?php echo hs($_POST['msg']) ?></textarea>
		</div>
		<div>
			<input type="submit" name="enviar" value="Enviar" />
		</div>
</form>

XHTML 单列表格

<style>
form br{clear:left;}
label {width: 240px;margin: 0 0 5px;}
input {width: 240px;height: 25px;line-height:25px;margin: 0 0 10px;border:1px solid #333;padding:0 0 0 6px;}
textarea {width: 240px;height: 115px;}
.submit{margin:0;padding:0;width:auto;height:auto;background:none;color:#000;}

/*checkbox*/
.checkbox{}
.checkbox label{width:auto;margin:0;padding:0;}
.checkbox input{width:auto;height:auto;margin:0;padding:0;border:0;}
</style>
<form action="#" method="post">
	<fieldset>
		<label>Text<span class="error"> Error!</span></label><br />
		<input type="text" value="" /><br />
		<textarea cols="30" rows="10"></textarea><br />
		
		<div class="checkbox"><input type="checkbox" name="" id="" /><label for="">Text</label></div>
		
		<input type="submit" class="submit" value="text" />
	</fieldset>
</form>