PDA

View Full Version : align head with top of page


orange8
05-25-2006, 01:39 PM
I am sure this is simple but i cant get it to work. I only want to align my header with the top of the page (so that there is no margin, flush)with out absolute positioning. The wrapper Div is centred on the page. The only way i can get it to work is by reducing the margin to -30px, but that only works in FF. Any ideas?

css:
#wrapper {
padding:0px;
margin:0px;
margin-left: auto;
margin-right: auto;
width: 700px;
text-align:left;
min-width:700px;
background-color:#000000;
}

body{
background-color:#CCCCCC;
text-align:center;
}
html:
<div id="wrapper">
<div id="header">
<img src="myheader.gif"></div>
</div

Arbitrator
05-25-2006, 01:56 PM
This should work:

* {
margin: 0;
padding: 0;
}

body {
background: #ccc;
}

#wrapper {
width: 700px;
min-width: 700px;
margin: 0 auto;
background: #000;
}

#header {
height: XXX;
background: url("myheader.gif") no-repeat;
}

[...]

<div id="wrapper">

<div id="header"></div>

</div>

orange8
05-25-2006, 02:11 PM
Cheers dude....works a treat.