Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

background images

Status
Not open for further replies.

dee2005

Programmer
Sep 11, 2005
29
GB
Hi
I have this problem when using a background-image of a certain
height 8px to be exact. IE 6 add extra spacing at the bottom, whereas firefox it is fine. This leaves a gap between the top and bottom image;

here is my code:
#displayHeaderTop{float:left; width:746px;}

#greywhiteborderLeft{float:left; width:8px; height:8px; background:url(player/i/whitegrey_cornerleft.gif) no-repeat top left;}
#greywhiteborderMiddle{float:left; width:92px; height:8px; background:url(player/i/whitegrey_top_center.gif) repeat-x top left;}
#greywhiteborderRight{float:left; width:8px; height:8px; background:url(player/i/whitegrey_top_right.gif) no-repeat top left; padding-right:10px;}

<div id="displayHeaderTop">
<div id="greywhiteborderLeft"></div><div id="greywhiteborderMiddle"></div><div id="greywhiteborderRight"></div>

can anyone help

 
Try adding [tt]font-size: 0;[/tt] for IE. IE sometimes likes to make space for potential text in divs.
 
Thank you both, I tried the overflow hidden it didn't work the font-size:0; did reduce the size but too much. However I added &nbsp; between the div's and the space was reduce. I gather IE doesn't like empty divs
 
Actually, it's probably a doctype. Have you validated your html against your doctype? Use this validation service...
If you page doesn't validate, then the problems you are experiencing could be because you have faulty html. The suggestions they give on that validation site will help you fix your html, and may resolve this issue completely.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Thanks for your response, they were helpful
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top