我正在尝试通过单击鼠标来获得下拉菜单的外观。我到目前为止的 html 看起来有点像这样
<div id="tabs">
<ul id="tab_list">
<li><a href="" id="tab1" class="active">Contents</a></li>
<li><a href="" id="tab1" class="active">Contents</a></li>
<li><a href="" id="tab1" class="active">Contents</a></li>
</ul>
</div>
<div id="tab_contents">
<div class="">
<h2>The table of contents</h2>
<p>The descriptive text for this tab</p>
</div>
<div class="hide">
<h2>About the author</h2>
</div>
<div class="hide">
<h2>About the downloads</h2>
</div>
</div>
和CSS
#tabs{margin-top: 1em;}
#tab_list{margin: 0;
padding: 3px 6px;
border-bottom: 1px solid black;}
#tab_list li {list-style-type: none;
display: inline;}
#tab_list li a {padding: 3px 1em;
margin-left: 3px;
text-decoration: none;
font-weight: bold;
color: black;
background: yellow;
border: 1px solid black;
border-bottom: none;}
#tab_list li a:hover{background: white;
border-color: black;}
#tab_list li a:active{background-color: white;
border-bottom: 1px solid white;}
#tab_contents div{padding: 5px 10px 10px;
border: 1px solid black;
border-top: 0;
height: 100px;}
.hide {display: none;}
现在我想根据我选择的类别隐藏和显示每个内容页面。我怎样才能获得这种效果?请直接在我的示例中工作。