73pixieGirl
Programmer
Hello...I'm working on a web page, using CSS and XHTML (a newbie), and I can't figure out what is causing there to be a space (2-3px) between my header image (in a div tag), and my main content area (another div tag). I thought it was the image, but I created a new one with the same dimensions and still shows the space. When I rename the image to one that doesn't exist (so it shows the box with the red x), the space goes away, and the borders of my divs are aligned, which before one was 1 or 2px off. Some other things that might be helpful, I'm using IE, and my files reside on my PC (not ready to move them to the server). I'll post my code for you to see, and if you have any comments on how I might better the code I would appreciate it! Thanks in advance!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<html xmlns="<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">
#welcome
{
background-image: url('images/watermark.gif');
background-repeat: no-repeat;
background-position: center;
border-left: 1px solid #000000;
border-right: 1px solid #000000;
}
#welcome h1
{
font-family: Arial, Verdana;
font-size: 12pt;
color: #000000;
padding-top:50px;
padding-left:50px;
}
#welcome p
{
font-family: Arial, Verdana;
font-size: 10.5pt;
color: #000000;
padding-left:50px;
padding-right:50px;
}
</style>
</head>
<body>
<div id="header" style="width: 800px;height: 154px">
<img src="images/header2.jpg" alt="This is the header image" />
</div>
<div id="welcome" style="width: 800px;height: 450px">
<h1>Welcome!</h1>
<p>This is where the page content will go.</p>
</div>
<div id="footer" style="width: 800px;">
<img src="images/footer2.jpg" alt="This is the footer image." />
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<html xmlns="<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">
#welcome
{
background-image: url('images/watermark.gif');
background-repeat: no-repeat;
background-position: center;
border-left: 1px solid #000000;
border-right: 1px solid #000000;
}
#welcome h1
{
font-family: Arial, Verdana;
font-size: 12pt;
color: #000000;
padding-top:50px;
padding-left:50px;
}
#welcome p
{
font-family: Arial, Verdana;
font-size: 10.5pt;
color: #000000;
padding-left:50px;
padding-right:50px;
}
</style>
</head>
<body>
<div id="header" style="width: 800px;height: 154px">
<img src="images/header2.jpg" alt="This is the header image" />
</div>
<div id="welcome" style="width: 800px;height: 450px">
<h1>Welcome!</h1>
<p>This is where the page content will go.</p>
</div>
<div id="footer" style="width: 800px;">
<img src="images/footer2.jpg" alt="This is the footer image." />
</div>
</body>
</html>