<分区>
Possible Duplicate:
How to keep the header static, always on top while scrolling?
我想在向下滚动页面时始终将网站的标题部分保持在顶部。 我该如何处理 CSS?还是我必须使用 Jquery?
<分区>
Possible Duplicate:
How to keep the header static, always on top while scrolling?
我想在向下滚动页面时始终将网站的标题部分保持在顶部。 我该如何处理 CSS?还是我必须使用 Jquery?
最佳答案
您可以使用 CSS 来实现,此类将适用于 ID 为“header”的 div:
#header {
position:fixed;
top:0;
z-index: 1000;
}
关于jquery - 标题部分始终位于网站顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10345547/