如何在所有浏览器(如IE
)的页面顶部创建一个固定位置的div答案 0 :(得分:2)
一个始终位于页面顶部的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>
答案 1 :(得分:0)
foo { position: fixed !important; position: absolute /* fallback for IE6 */; }