Forum Moderators: not2easy

Message Too Old, No Replies

space below background image in IE

image has space below it in IE

         

erdy

10:30 pm on Jul 14, 2007 (gmt 0)

10+ Year Member



Hi,

I have a div that has a height of 15px.
In the HTML code there is nothing in that div, but the CSS code gives it a height of 15px and a background image that also has a physical height of 15px.

However in IE 6 there seems to be a small gap below the background image. It seems as though the div is about 18px high
In Firefox and all other normal browsers there is no gap.

***********************
Here is the HTML code:
***********************

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title>Home Page Test Page</title>

<link rel="stylesheet" type="text/css" href="psw_css.css"/>

</head>
<body id="home">

<div id="container">

<div id="header"></div>

<div id="hori_nav"></div>

</div><!--container-->

</body>

</html>

***********************
HERE IS THE CSS CODE:
***********************

body{
margin: 0;
text-align: center;
}

#container {
width: 760px;
height: 550px;
border: 1px solid black;
margin: 0 auto;
}

#header{
height: 130px;
border: 1px solid black;
}

#hori_nav {
height: 15px;
border: 1px solid black;
background: url(images/hori_nav.jpg) top center no-repeat;
}

Can anyone help

Thanks

Erdy.

Marshall

2:18 am on Jul 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Try setting the padding to 0 in that specific <div>.

Marshall

[edited by: Marshall at 2:18 am (utc) on July 15, 2007]

DrDoc

2:26 am on Jul 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It could also be directly related to the font size.
Try
line-height: 15px
too.