Wh开发者_StackOverflow中文版at is the best practice for creating a hovering "frame" in ASP.NET which will remain stationary at the top of a web page regardless of how the user scrolls vertically?
For example, if I create a textbox to contain search criteria, I might want the area of that textbox to remain stationary at the top of the browser window, allowing the user to scroll among the results freely and if they wish update their search criteria.
Here is a working example: http://jsfiddle.net/srPPu/2/ (edit: better link)
Using css create an element thats position is fixed on the top of the page (meaning it will not scroll
#search{
position:fixed;
width:100%;
height:25px;
background:#eeeeee;
clear:both;
}
#content{
padding-top:20px;
}
精彩评论