如何在页面顶部制作一个固定位置的div,在所有浏览器(如IE)中都能正常工作
最佳答案
始终位于页面顶部的 div(在本例中,距离顶部 5px):
CSS:
.mydiv {
position: absolute;
top: 5px; /* or however far you want it from the top of the page */
}
HTML:
<div class="mydiv">this will always be 5px from the top of the page</div>
关于javascript - 制作一个固定位置的div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2986914/