2 replies [Last post]
FredHead
Offline
newbie
Arizona
Last seen: 13 years 7 weeks ago
Arizona
Joined: 2007-10-11
Posts: 2
Points: 0

Hi,

I've got a nav using an HTML UL tag and styled with CSS. I've got images within the LI tags. I'm getting a persistent 4 pixel right padding error which appears part of the LI tag but it persists even when I set padding (and margin) to 0. I'm also getting a 1px gap up top. This error appears in FF and IE7, at least. I've styled the #mainmenu background as black so you can see the gap; otherwise, it should be transparent. Here's the cleaned up page/css URL if you can help:

http://redhorseinternet.com/work/css/index-clean.html

One oddity is that the error mostly goes away if I stream the code into a single line of code. In that sense, it's like the old browser issue circa 1996 where not putting the tag right after an image introduced a persistent space to the right of an image.

Is there a CSS solution to this problem? It's making me nuts and wasting my time. I post the problem here in case someone has seen this or has a better way to achieve my goal.

Thanks for any help!

Tim

k3liutZu
Offline
Regular
Cluj, Romania
Last seen: 13 years 7 weeks ago
Cluj, Romania
Joined: 2007-04-26
Posts: 18
Points: 0

Add a float: left; to your

Add a float: left; to your li elements, and remove the padding from the images.Wink

FredHead
Offline
newbie
Arizona
Last seen: 13 years 7 weeks ago
Arizona
Joined: 2007-10-11
Posts: 2
Points: 0

Thank you!

That works beautifully. Thanks!

Tim