我想知道当我向下滚动时是否有机会在屏幕上保留一个固定的标题,我该怎么做?
我试图在 .header.dark
类中添加 CSS position: fixed;
但它破坏了模板。
感谢您的帮助。
最佳答案
应该可以正常工作。试试这个:
<div class="header">This is the header</div>
CSS
.header {
position:fixed;
width:100%;
top:0;
left:0;
background:blue;
z-index:999;
}
关于html - header 位置 : fixed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21916658/