Remove white spaces, padding?
I just starting off learning divs and css, I'm trying have a gradiant within a div which is at the top of the page called "blacktop.gif". I have a almost completed this but I think I have a problem with the margins or padding? The white padding is appearing on the right side of the screen, I want the images to be repeat 100% across with no white padding on top,left or right.
This here is a image of the problem:
http://img394.imageshack.us/img394/5691/cssproblemnc5.jpg
Here is the xhtml/css which I am using:
<!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>Verical Background</title>
<style type="text/css">
<!--
div#header {
background-image:url(images/blacktop.gif);
background-repeat: repeat-x;
width:100%;
margin-top:-8px;
margin:-8px
margin-right:-8px;
margin-left:-8px;
padding:0px;
float:left;
height:400px;
-->
</style>
</head>
<body>
<div class="header" id="header">Header</div>
</body>
</html>
teammatt3 posted this at 02:02 — 13th April 2008.
He has: 2,102 posts
Joined: Sep 2003
Try this in your CSS:
body {
padding:0;
margin:0;
}
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.