介绍下css样式之background背景色的设置例子。
代码:
<!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">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<style type='text/css'>
#footer
{
background:#71A70B;
clear:both;
color:#fff;
font-size:.9em;
height:1.8em;
line-height:1.8em;
padding:0;
text-align:center;
}
#footer a
{
background:inherit;
color:#fff;
text-decoration:none;
}
#footer a:hover
{
text-decoration:underline;
}
#footer .left
{
margin:0 0 0 8px;
}
#footer .right
{
margin:0 8px 0 0;
}
</style>
<title>css样式实例之background:inherit---www.jb200.com</title>
</head>
<body>
<div id="footer">
<span class="left">© 2013 Your Site</span>
<span class="right">Designed by <a href="http://www.jb200.com">脚本学堂</a>| <a href="/">Web Hosting</a>
</span>
</div>
</body>
</html>