2010-06-07 127 views

回答

2

一个div,将永远留在页面顶部所有的浏览器页面的一个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>