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
2009-06-23 00:57:31
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>
2009-06-23 01:49:35
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
2009-06-23 02:27:13
"This element has no style rules"
2009-06-23 04:45:45
I filed bug 499911 with Bugzilla.
2009-06-23 16:28:47