gpt4 book ai didi

html - 更改图像和侧边栏

转载 作者:行者123 更新时间:2023-11-28 13:55:34 24 4
gpt4 key购买 nike

我正在尝试通过单击鼠标来获取下拉菜单的外观。到目前为止我的 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;}

现在我想根据我选择的类别隐藏和显示每个内容页面。我怎样才能获得这种效果?请直接在我的例子中工作。

最佳答案

如果我理解正确你想要什么,我不确定它是否可以在没有 js 的情况下完成,为什么你有相同 id 的标签?

关于html - 更改图像和侧边栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10858738/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com