mikegreenia.com
06-04-2008, 09:49 PM
I'm just fooling around with a box model but I can't figure out why my images are coming out the way they are on the screen. If you look at the top and bottom images they have no background but when I place them on a black background it repeats. Is this a CSS problem or do my images have to have the same background as my HTML page will have?
LINK: http://mikegreenia.biz/test/
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test Page</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<center>
<br />
<div class="box">
<div class="top"></div>
<h1>header</h1>
<p>text text</p>
<p>text text</p>
<h1>header</h1>
<p>text text</p>
<p>text text</p>
<div class="bottom"></div>
</div>
</center>
</body>
</html>
CSS:
@charset "utf-8";
/* CSS Document */
body {
background-color:#000000;
}
.box {
width: 729px;
padding: 0 20px;
background-image: url(mid_bg.gif);
}
.box .top {
height: 21px;
font-size: 1px;
margin: 0 -20px;
background-image: url(top_bg.gif);
}
.box .bottom {
height: 24px;
font-size: 1px;
margin: 0 -20px;
background-image: url(bot_bg.gif);
}
LINK: http://mikegreenia.biz/test/
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test Page</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<center>
<br />
<div class="box">
<div class="top"></div>
<h1>header</h1>
<p>text text</p>
<p>text text</p>
<h1>header</h1>
<p>text text</p>
<p>text text</p>
<div class="bottom"></div>
</div>
</center>
</body>
</html>
CSS:
@charset "utf-8";
/* CSS Document */
body {
background-color:#000000;
}
.box {
width: 729px;
padding: 0 20px;
background-image: url(mid_bg.gif);
}
.box .top {
height: 21px;
font-size: 1px;
margin: 0 -20px;
background-image: url(top_bg.gif);
}
.box .bottom {
height: 24px;
font-size: 1px;
margin: 0 -20px;
background-image: url(bot_bg.gif);
}