Reputation: 8610
I have a big html page, which requires lots of scrolling. I'd like to have a <div>
element shown absolute to browser window, so that it is always visible, no matter where I scroll the page.
I tried using css for div element position: absolute;
but it does not help in this case.
How can it be done?
Upvotes: 0
Views: 143
Reputation: 9174
You need position: fixed
for achieving that
Here is a small tutorial
http://davidwalsh.name/css-fixed-position
Upvotes: 6
Reputation: 2330
Use the property,
position:fixed
It is the css property to position the element relative to the browser window
Upvotes: 0
Reputation: 2535
Using position:fixed
would be a great choice, see DEMO here.
However, for compatibility reason, IE 6 doesn't support position:fixed
, you should use some javascript hack to do so.
Upvotes: 0