tags:

views:

111

answers:

1

If I use an inline element in Firefox and put a background color on it, the element appears to have a 1px margin across the top. This doesn't happen in IE8, Safari 4 or Chrome 2. They show the element flush with whatever is above it. I've tried Firefox 3 and 3.5 with the same results. Using display:inline-block; will fix the problem but I don't think that's what it's made for. Any idea what is going on?

A: 
Artem Russakovskii
It appears to be picking up a top offset of 1px. Here's the sample code.<html><body style="margin:0px;"><a href="#">Test</a></body></html>
Click on the Style tab and see where the value is inherited from. You will see things crossed out, which means the value is defined elsewhere. Just follow the inheritance and you'll figure it out.
Artem Russakovskii
"This element has no style rules"
I filed bug 499911 with Bugzilla.