以下Html代码是本书第五章的范例代码,点击此链接查看演示效果
<!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" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Chapter 5: Indestructible Boxes</title>
<style type="text/css" media="screen">...
body {...}{
font-family: Arial, sans-serif;
font-size: small;
}
a {...}{
color: #00458B;
}
/**//* Netflix box */
.box {...}{
width: 273px;
background: url(img/div-bottom.gif) no-repeat bottom left;
}
.box h3 {...}{
margin: 0;
padding: 6px 8px 4px 10px;
font-size: 130%;
color: #333;
border-bottom: 1px solid #E0CFAB;
background: url(img/h3-bg.gif) no-repeat top left;
}
.box ul {...}{
margin: 0;
padding: 14px 10px 14px 10px;
list-style: none;
}
.box li {...}{
margin: 0 0 6px;
padding: 0;
}
/**//* Indestrucible box */
.container {...}{
float: left;
margin: 20px 0;
padding: 0;
color: #666;
background: url(img/rounded-right.gif) top right no-repeat;
}
.desc {...}{
margin: 0;
padding: 9px 9px 0 9px;
background: url(img/rounded-left.gif) top left no-repeat;
}
.link {...}{
margin: 0;
padding: 0 0 0 9px;
background: url(img/rounded-left.gif) bottom left no-repeat;
}
.link em {...}{
display: block;
padding: 0 9px 9px 0;
font-style: normal;
background: url(img/rounded-right.gif) bottom right no-repeat;
}
.container a {...}{
font-size: 130%;
color: #e70;
}
</style>
</head>
<body>
<div class="box">
<h3>Gifts and Special Offers</h3>
<ul>
<li><a href="/purchase/">Purchase Gift Subscription</a></li>
<li><a href="/redeem/">Redeem Gift Subscription</a></li>
<li><a href="/view/">View Purchase History</a></li>
</ul>
</div>
<div class="container">
<p class="desc">This box is:</p>
<p class="link"><em><a href="/browsers/firefox/" class="firefox">Indestructible!</a></em></p>
</div>
</body>
</html>