<p>I am having trouble with IE7. I have a header, which is an IMG. Under it I have a div that represents a menu, they have to be attached to each other without space in between. Both are 1000px width. In Opera and FireFox the header and the menu are neatly attached to each other. However, in IE7, there is a small space between the menu DIV and the IMG. I have tried explicitly defining padding and margin on the IMG, however it does not work. I have had this problem before, so it seems to be a IE7 quirk.</p>
<p>My HTML Code:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="middle"&gt;
  &lt;img id="ctl00_headerHolder_headerImage" src="pictures/headers/header_home.jpg" style="border-width:0px;" /&gt;

  &lt;div id="ctl00_menuPanel" class="menu"&gt;
    &lt;a id="ctl00_home" href="Default.aspx" style="color:#FFCC33;"&gt;Home&lt;/a&gt; |
    &lt;a id="ctl00_leden" href="Leden.aspx"&gt;Leden&lt;/a&gt; |
    &lt;a id="ctl00_agenda" href="Agenda.aspx"&gt;Agenda&lt;/a&gt; |
    &lt;a id="ctl00_fotos" href="Fotos.aspx"&gt;Foto's&lt;/a&gt; |
    &lt;a id="ctl00_geschiedenis" href="Geschiedenis.aspx"&gt;Geschiedenis&lt;/a&gt; |
    &lt;a id="ctl00_gastenboek" href="Gastenboek.aspx"&gt;Gastenboek&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

[{'answer_id': 13854, 'author': 'Nick Berardi', 'author_id': 17, 'author_profile': 'https://Stackoverflow.com/users/17', 'pm_score': 3, 'selected': True, 'text': '<p>Try the IE Developer Toolbar, which will let you inspect what is going on with the elements and give you outlines of the areas covered.  It might give you a better understanding of the problem.</p>\n'}, {'answer_id': 13855, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>The solution: </p>\n\n<pre><code>img {\npadding: 0px;\nmargin: 0px;\ndisplay: block;\n}\n</code></pre>\n\n<p>display: block</p>\n'}, {'answer_id': 13860, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>I run into this a lot. Rather than hunting down the specific behavior, try sanity checking by explicity setting padding and margin properties for img/div/etc selectors to 0, set border-style: none border-width: 0px border="0" etc.</p>\n\n<p>IE Dev Toolbar is a must-have but whether it helps you with figuring out single-pixel issues is unlikely.</p>\n'}, {'answer_id': 13866, 'author': 'eplawless', 'author_id': 1370, 'author_profile': 'https://Stackoverflow.com/users/1370', 'pm_score': 0, 'selected': False, 'text': '<p>Instead of resorting to display block, note that IE7 does some seriously odd things with whitespace; try removing the whitespace between the image and the div, and see what happens.</p>\n'}, {'answer_id': 13868, 'author': 'Jon Galloway', 'author_id': 5, 'author_profile': 'https://Stackoverflow.com/users/5', 'pm_score': 0, 'selected': False, 'text': '<p>CSS Resets (like the <a href="http://developer.yahoo.com/yui/reset/" rel="nofollow noreferrer">YUI Reset CSS</a>) are great for this kind of thing. They reset paddings, margins, and other display properties on a lot of HTML elements to minimize the display differences.</p>\n'}, {'answer_id': 13903, 'author': 'Polsonby', 'author_id': 137, 'author_profile': 'https://Stackoverflow.com/users/137', 'pm_score': 0, 'selected': False, 'text': "<blockquote>\n  <blockquote>\n    <p>The solution...display: block</p>\n  </blockquote>\n</blockquote>\n\n<p>That question couldn't be answered properly without knowing the rendering mode that the browser was in; you need to tell people what doctype you have if you have CSS rendering issues. The image behaviour you refer to is different in quirks mode as opposed to standards mode. A minimal test case must include a full HTML document and the CSS to reproduce the problem. Please don't ask people for help without giving them the information they need to answer easily without wasting their time...</p>\n"}, {'answer_id': 14183, 'author': 'Akira', 'author_id': 795, 'author_profile': 'https://Stackoverflow.com/users/795', 'pm_score': 0, 'selected': False, 'text': '<p>The real solution:</p>\n\n<pre><code>#middle { font-size: 0; line-height: 0; }\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/13851', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']