-1

There's 'Why are there gaps between image rows in tables when the layout engine is in the Standards mode?' in Mozilla Web Developer FAQ (And here's more detailed explanation)

I also saw this issue mentioned in meyer's 'CSS: The Definitive Guide'.

But I've tested it on firefox 10.0.2, ie8 and chrome 17.0.963.56, and all resulted in no gaps at all.

Here's the tag I used.

<table>
  <tr>
    <td style="padding:0; background-color:red;">
      <img src="https://developer.mozilla.org/@api/deki/files/718/=Images-tables-gaps-figure1.gif" />
    </td>
  </tr>
</table>
alice
  • 2,547
  • 4
  • 24
  • 30
  • 1
    I'm not following. What is your question? It seems like you're not experiencing any issues. Can you please clarify? Thanks! – SenorAmor Mar 02 '12 at 14:55
  • 1
    Did you notice the button you clicked for writing this is labeled `Ask Question` :) – arunes Mar 02 '12 at 15:01
  • According to the Mozilla FAQ and mayer's book, there should be the gaps in the standards mode. But I couldn't reproduce it even in the firefox, so which modern browsers have this behavior? – alice Mar 02 '12 at 15:03

1 Answers1

0

Are you absolutely certain you're in Standards mode on the page you're testing? If your page isn't fully compliant, the browser may be changing to quirks mode without asking - in which case the images do not have a gap. (Check here for examples of how to find if your browser is using standards or quirks mode)

The following page does exhibit the gap in Chrome and IE, at least. Remove the doctype declaration, and you'll see no gaps. Keep it, and you'll see the gap.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head></head>
<body>
<table border="1">
<tr><td>
<img src="" width="20" height="20" />
</td></tr>
</table>
</body>
</html>
Community
  • 1
  • 1
Sheldon Griffin
  • 4,405
  • 1
  • 14
  • 5
  • You're right! I've tested it using http://htmledit.squarefree.com, and I thought standards mode is enabled by default, which is not true. – alice Mar 02 '12 at 17:55