单击选项卡时如何将背景更改为完全相同的颜色?目前,它只是保持相同的颜色。当页面加载时,是否可以让第一个选项卡的颜色与内容区域的背景颜色相同?
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CSS-TABS | CSS-Only "DOM TABS"</title>
<style type="text/css">
#pagewidth { width: 760px; margin: 0 auto 0 auto; }
#navigation { margin: 0 10em 0 0; background: #000000; color: #FFFFFF; }
#navigation li { display: inline; padding: 0 2em 0 2em; }
.content { background: #CCCCCC; height: 20em; padding: 1em;}
a { color: #0066FF; }
a:hover { color: #00CCFF; }
a:active { font-weight:bold; }
#container { height: 20em; overflow: hidden; }
</style>
</head>
<body>
<div id="pagewidth">
<ul id="navigation">
<li><a href="#c1">Content Block 1</a></li>
<li><a href="#c2">Content Block 2</a></li>
<li><a href="#c3">Content Block 3</a></li>
</ul>
<div id="container">
<div class="content">
<a name="c1" id="c1"></a>
<h1>Heading 1</h1>
<p>Here is some content, I hope that you like it!</p>
</div>
<div class="content">
<a name="c2" id="c2"></a>
<h2>Heading 2</h2>
<p>Now that you have read content block 1, you can learn more in this block</p>
</div>
<div class="content">
<a name="c3" id="c3"></a>
<h3>Heading 3</h3>
<p>In conclusion, content blocks are fun</p>
</div>
</div> <!-- end container -->
</div> <!-- end pagewidth -->
</body>
</html>