Forum Moderators: not2easy

Message Too Old, No Replies

First time coding css, need help with divs that go 100% across page!

there is a whitespace between the sides of the pages with my div!

         

GamingLoft

9:08 pm on Feb 17, 2008 (gmt 0)

10+ Year Member



I think you get the problem from the title, but im new to css, and stuff so i really need help with this.

ok i need my div to be like this across the page

whole page...
¦-------------------------------------------------------¦
¦--------------------------DIV--------------------------¦
¦-------------------------------------------------------¦

but its like this..

¦##¦-------------------------------------------------¦##¦
¦##¦-----------------------DIV-----------------------¦##¦
¦##¦-------------------------------------------------¦##¦

the ## represents whitespace on the page.

ok here is my code...


<html>
<head>
<title> stupid junk </title>
<style>
#adarea{
height: 119px;
width: 100%;
position:relative;
left:-10px;
border: 1px solid black;
padding-top:14px;
padding-left: 23px;
align: center;
background-image:
url('images/adarea.png');
background-repeat: repeat-x
}
</style>
</head>
<body>
<div id=adarea>
<img src="https://www.google.com/adsense/static/en_US/images/leaderboard.gif">
<img width="30px" src="images/spacer.gif">
<img src="http://www.google.com/images/adsense/120x60_blue_adsense_c.gif">
</div>
</body>
</html>

swa66

11:17 pm on Feb 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I suspect you're seeing the default margin on the body

Add

* {margin:0;padding:0} near the start of your css.

It'll remove all default margins and padding your browser is inserting.
Obviously you'll need to add some padding and/or border on elements such as p , ul, ...