PDA

View Full Version : How to fixed top div using css?



noahwilson
05-20-2013, 05:15 AM
Hello Guys,
I did try to fix my top div but when i set position:fixed for top div then the div goes in left. please help me to fixed it.
i am using like that;
<div id="top"></div>
<div id="content"></div>

CSS code
#top
{
position:fixed;
z-index:100;
}
Please help me to solve out this proble.

binarynpixel
05-20-2013, 03:16 PM
Where is main container? first keep all content and div in a main container div and keep this container margin 0 auto; and after your can be fixed any div otherwise you may be face overlapping problem with your design.