CSS Sticky Div on top of my page

I wanted to create a div that will serves as toolbar on my page till i come up with this one.

STICKY DIV ON TOP ON MY PAGE : CSS
----------------------------------

#tool-bar {
background:#777777 none repeat scroll 0%;
border-bottom:1px solid #292929;
color:#ccc;
font-size:85%;
padding-top:2px;
height:15px;
left:0pt;
position:fixed;
top:0pt;
width:100%;
z-index:1;
}



On my html page
------------------
<div id=\"tool-bar\">
My Tool Bar Floating on top of my page
</div>

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Works Great EXACTLY what i was looking for. I might suggest though that you set the z index a bit higer. alot of js nav menus set theirs to 10 or 15 so they will be on top of images sliders and such. I had to set mine to 25 to make it sit on top. Im using it for a notification dialog. margin left & right to auto, width 500px border radius 10px. looks great. works like a dream. thanks a ton!

    ReplyDelete