April 25, 201214 yr Hi guys, I haven't had a problem with displaying my nav bars inline before in IE7, and I have used the same code this time but this time it will not display inline whatever I do! It is just displaying vertically. I 've had a good read about and it seems like people have a lot of problems, and I've tried the applying the suggested 'zoom:1;' to the li and link elements, but still no luck. Here is my CSS for the nav bar. #nav { width:680px; height:32px; float:right; margin:18px 0px 0px 0px; } #nav ul { width:680px; list-style:none; display:inline; } #nav ul li { float:right; display:inline; margin:0px 0px 0px 6px; } #nav ul li a { display:block; height:32px; float:right; } Any ideas?
April 25, 201214 yr Remove "float:right;" from the li's. Floating an inline element doesn't really work, especially in older browsers. Technically, all floated elements should be a block as floats require a width which inline elements don't have.
Create an account or sign in to comment