Development Blog

HTML links are like span tags

Ok maybe you are up on your HTML more than I am, but I was surprised that an <a> tag around an image does not have a CSS box around the image.  This came up in  issue 2534.  The reporter had an example like the one below, with an <a> tag around an image:


If you inspect the image in Firebug, then mouse over the <a> tag, you can see that the <a> tag’s box is smaller than the image. But Firebug’s inspect is correct: the CSS box for an <a> tag is similar to a <span> tag. They are both “inline” elements, so the image is not contained in their box.

For a more dramatic example, see the test case for issue 2534. Thanks to Boris for helping us sort this out.


Please post followups to the newsgroup.

Comments are closed.