Jump to content

Extra height in IE6


ryanh_106

Recommended Posts

Hi,

 

I have a header div that contains two images that are both 102px high and a background (repeated along y) that is 102px high with a border along the bottom of 5px. For some reason, if I set the height to auto (or dont specify it) then there is a 5px gap (in which the background colour of the div shows through) between the bottom of the images and the border. If I set the height specifically to 102px then the problem is rectified in IE6 and FF but remains in IE6. I also tried to place the border on a wrapper div (as shown below) but this did not help, there still seems to be something pushing the header down. Any advice as to why this is happening is apprecaited.

 

Cheers

 

HTML:

<div id="headerborder">
    <div id="header">
        <img src="templates/controlpanel/images/logo.gif" title="This is our logo" id="logo" />
        <img src="templates/controlpanel/images/rightimage.gif" id="cds" />
    </div><!--END HEADER-->
</div><!--END HEADERBORDER-->

 

CSS:

 

#header { background-color:#ff0000; 
        background-image:url('images/headerbg.gif'); 
        background-position:top; 
        background-repeat:repeat-x; display:block;
        margin:0px; padding:0px; 
        width:100%; height:102px; text-align:right; }
#headerborder { width:890px;
        border-bottom:5px solid #346391; }

 

 

Link to comment
Share on other sites

Ok ill try rack up a full example (cant just dump the actual code as its work related :P)

 

I thought there was some known issue with IE6 and borders being included with heights, guess i was hoping it would be a simple answer!

 

Ill put something together and get back to you.

 

Cheers

Link to comment
Share on other sites

It's not the double margin bug. That is only triggered when an element is floated and has margin on the same side as the side it is floated towards. It is easily fixed by adding {display:inline;} to the IE6/5 stylesheet.

 

To fix this problem you just need to use:

 

#header img {display:block;}

 

to display the images as block items and remove that space that appears below them.

Link to comment
Share on other sites

It's not the double margin bug. That is only triggered when an element is floated and has margin on the same side as the side it is floated towards.

 

Exactly why I want to see what else he has. Does he have floated elements before or after his header element (like a left side nav box AND a right side content box floated left with no container or clearing).

 

Or absolutely positioned elements with block level header tags (I've had instances where IE includes the default header tags to the html flow as if it had been positioned relative instead).

 

I've had occasion where just specifying text-align:right will cause IE to auto tack on a default right margin, and if he didn't specify img {border:none(or 0)} it will add a right margin.

 

All of the bugs are "easily fixed", knowing which is being triggered is the key, though.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.