Reputation: 68740
How would I have a DIV stay at the top of the page visually as the user scrolls down a web page?
A simple Javascript framework would be great!
it's for this web site: http://BiblePro.BibleOcean.com
Upvotes: 30
Views: 99103
Reputation: 41
That is simple, just make the top Div position and it will work fixed e.g
Start div tag
<div style="position: fixed;background: #336699; width: 100%;">
Be at the top end div tag
Upvotes: 3
Reputation: 137997
If you don't care about IE6, you can use position: fixed
:
div {
top: 0;
position: fixed
}
Using jQuery, see this question: What is the simplest jQuery way to have a ‘position:fixed’ (always at top) div?
Upvotes: 49