Noo*_*AFK 0 html css css-selectors
所以这是情况,当导航在底部时,拳头代码显示类......
<div id="navigation" class="attached-to-bottom">
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
当我向下滚动(使用 jquery 等)后,当我的导航保持在顶部时显示,但是当我触发类“附加到顶部”时,我需要将导航 ID 高度更改为不同)我可以只使用 CSS 还是?
<div id="navigation" class="attached-to-top">
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
只是不要在它们之间使用空格。
#navigation.attached-to-top { height: 100px; }
Run Code Online (Sandbox Code Playgroud)
有关CSS 选择器的更多信息