…blogs about design, branding and doing business.
I found a very strange rendering bug in IE7 today. It was particularly strange as it showed no symptoms in IE6. Firefox & Safari (as is usually the case) displayed it perfectly.
Here’s the (abridged) code for the section I was working with and the associated screenshot of the problem. Basically, IE7 was adding a 10-pixel padding to numerous elements proceeding down the page.
<h2 class="BlueBar">Details of your loan</h2>
<div class="Full">
<h3>About this loan</h3>
<table summary="Details of this loan" cellspacing="0" class="AboutLoan">
<tbody>
<tr class="Odd">
<th>Loan amount</th>
<td>£2,500</td>
</tr>
</tbody>
</table>
</div>
As you can see the <h2> with the blue background and the <table> were totally unrelated, however IE7 deemed it fitting to add the gap to the left of all of the elements, in the case of the <h2> as left padding.
After much experimentation I tracked the problem down to an unrelated comment further up the page. Whilst I’m used to comments bugs in IE6 it was a new experience to find such a basic rendering error in IE7, given that my general experiences with CSS coding for the browser has been for the most part positive.
I’ve not had time to properly diagnose the problem or the specific conditions that cause it to occur but the short lesson for today is that IE7 shares comment-sensitivity with it’s problematic forefathers.
Please try to keep comments civil, constructive and on-topic.
On 17 Aug '07 at 1:55 pm Justin said:
I’m having the same issue with top padding on a footer div. IE6 and Firefox fender the footer find but my 65px of top padding turns into 130px roughly. Very strange.
On 4 Jan '08 at 9:40 am Wing Fat said:
I’m having the same problem as Justin. I read that adding “display:inline” to your float will fix the problem but it doesn’t in my case.
On 5 Nov '08 at 10:46 am bengilman said:
@Wing Fat – the display:inline code fixes the issue where IE will add a double margin to elements that have a margin on the same side as the float direction – as discussed here:
http://www.positioniseverything.net/explorer/doubled-margin.html
I believe that bug is fully fixed in IE7. The one I described seemed to be something quite different.
On 10 Nov '08 at 2:55 pm joe said:
I’m having a problem with the top padding of my website. for whatever reason the padding doubles. It doesn’t always happen. The problem randomly appears when hitting the refresh button or clicking onto another page on the site.
The site works fine in firefox, but not in IE6 – IE8.
Help, please!!??!!
the website is http://www.bostonwebsolutions.com/SmoothEssentials/Specials.php
On 10 Nov '08 at 3:16 pm bengilman said:
@Joe
I’m not able to recreate your bug in IE6 or 7. Some parts of your layout are a bit unconventional though I can see why you did it that way to get the footer to always stay at the bottom. I suppose one immediate thing to try is to put position:relative on the .scroll div. But in general the sort of layout you’re going for can be pretty troublesome.
Having had a quick scan around you might want to look at the way the technique has been achieved here:
http://www.wickham43.supanet.com/tutorial/headerfooterfixexample.html
That layout seems to work well in IE and Firefox.
Good luck with it.