justinede Posted May 27, 2009 Share Posted May 27, 2009 Hello, I am having some issues with my css. here is my navigation ul. <div id="nav"> <ul class="menu"> <li class="current"><a href="index.html">Home</a></li>| <li><a href="about.html">About</a></li> | <li><a href="news.html">News</a></li> | <li><a href="contact.html">Contact</a></li> </ul> </div> and here is my css: #nav { max-width: 960px; background: #3B3B3B; margin: 0 auto 0; text-align:left; color:#FFF } .menu { list-style: none; text-align:left; } .menu li { display:block; text-align:left; } .menu li a {color: #666; text-decoration:none; } .menu li a:hover { background: #cccccc; color: #fff; } .menu li.current a { background: #cccccc; color: #fff; } You can see my site here: http://justinledelson.com/portfolio/mothers/site1/ As you can see, it is inserting a break after each li. I dont know how to fix this. Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/159944-solved-breaking-after-each-li/ Share on other sites More sharing options...
Axeia Posted May 27, 2009 Share Posted May 27, 2009 First off, NEVER EVER put anything directly inside an ul that's not a <li>! Second, lists are vertical by nature, add .menu li { float: left; margin: 2px 20px; } to take care of that. You'll notice that it ruins makes other things go wrong, the easiest way to get around is by inserting a <div style="clear: both"></div> directly after the UL, there's a hard way to . Link to comment https://forums.phpfreaks.com/topic/159944-solved-breaking-after-each-li/#findComment-843577 Share on other sites More sharing options...
justinede Posted May 27, 2009 Author Share Posted May 27, 2009 Thank you! It worked. Link to comment https://forums.phpfreaks.com/topic/159944-solved-breaking-after-each-li/#findComment-843580 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.