Hi, i'm having a problem with the 'margin-top' property. Here's my current html and css -


<div id="nav"> <div id="navwrap">
           <li><a href="index.php"><img src="images/frame/homebtn.gif" width="63" height="20" /></a></li> 
           <li><a href="portfolio.php"><img src="images/frame/portfoliobtn.gif" width="93" height="20" /></a></li> 
           <li><a href="contact.php"><img src="images/frame/contactbtn.gif" width="84" height="20" /></a></li>
        </ul> </div>





Everytime i add the 'margin-top:15px' to the 'navwrap' div it applies it to the 'nav' div.

Any ideas?


Recommended Answers

All 4 Replies

It seems like it is working fine to me. I tried it on jsfiddle and locally and in neither case is it applying the margin to div#nav. I applied a border to each div in order to make it more clear. http://jsfiddle.net/dcdruck/gU6t9/1/ What browser are you using? I'm using Chrome.

thanks for your quick reply i tried it in firefox and ie and they are applying it to the #nav :/

The fiddle example looks OK from IE9 and Chrome.

I've tried it in Firefox (latest), Chrome (latest), IE 9 (including IE 8 and 7 modes of IE 9, and IE 6 and it all seems to look fine. Maybe you can try explicitly adding margin:0; to the style for #nav and see if that helps your situation.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.