Reputation: 135
Hey guys
I have a question which is... I want a panel at the top of my website that stays at the top of the web browsers view. like here
In this website the top panel stays at the top even though you scroll through the website
My question is can someone point me in the right direction on how to do this or tell me how to do this?
Upvotes: 0
Views: 589
Reputation: 18964
No javascript needed. Just use this css:
#idOfTheBanner { position:fixed;top:0px;}
Upvotes: 0
Reputation: 34855
This is what they used on the site you referenced.
Specifically, they are using 'position:fixed;
to keep it in place and z-index: 20;
to keep it on top.
#header {
background: url("../images/header.png") repeat-x scroll 0 top transparent;
position: fixed;
width: 100%;
z-index: 20;
height: 116px;
top: 0;
margin: 0;
padding: 0;
}
That should get you started.
Upvotes: 1