Reputation: 197
I am trying to stretch an image to the boundaries of the browser in IE8. It is working except the right, left, top, and bottom have white space about the size of 5px. I want the image to stetch COMPLETELY to all sides. My employer has hinted that this is the last straw if I can't get this page right :( Please help if you can..
HTML:
</head>
<body class="fullbackground">
<!--THIS IS THE BACKGROUND IMAGE--><img class="fullbackground" src="c:\documents and settings\zx08067\Desktop\Outage_Page\background.png">
<div class="top">
...
...
CSS:
body {
position:relative;
}
img.fullbackground {
position:absolute;
z-index:-1;
top:0;
left:0;
width:100%; /* alternative: right:0; */
height:100%; /* alternative: bottom:0; */
padding-left:0px;
padding-right:0px;
margin-left:0px;
margin-right:0px;
}
Upvotes: 0
Views: 396
Reputation: 12797
in your css add
html,body{
padding:0 0 0 0;
margin:0 0 0 0;
overflow-x:hidden; // To remove the bottom scrollbar
}
Hope it works.
Upvotes: 0
Reputation: 31
Try setting the body tag to have a margin and padding of 0.
body {
position:relative;
margin: 0;
padding:0;
}
Most web browsers have there own default styles on elements. Personally I always use a reset script like: http://meyerweb.com/eric/tools/css/reset/
Upvotes: 1