PDA

View Full Version : Div layout



Swinkid
31-07-2008, 01:42 PM
Hey all,
I want to center my Div layouts boxes, but every time i do, they go out of place like:
http://www.habbocafe.com/SITE/index.php

The only way i get them into place is to have this CSS:

body {
margin: 10px;
padding: 0px;
}
#container {
width: x-pixels;
height: auto;
margin: auto;
}
#marquee{
background: #0099FF;
width: 800;
}
#header {
background: #0f0;
width: 800;
}
#leftcol {
background: #f00;
width: 200;
background-position: left;
text-align: left;
}
#content {
background: #fff;
width: 600;
background-position: center;
text-align: center;
}
#footer {
background: #0f0;
clear: both;
width: 800;
}body {
margin: 10px;
padding: 0px;
}
#container {
width: x-pixels;
height: auto;
margin: auto;
}
#marquee{
background: #0099FF;
width: 800;
}
#header {
background: #0f0;
width: 800;
}
#leftcol {
background: #f00;
width: 200;
float: right;
}
#content {
background: #fff;
width: 600;
float: center;
}
#footer {
background: #0f0;
clear: both;
width: 800;
}
While having my contain box aligned to the left or removing it. But it aligns them to the left.
Note: the container is doing nothing atm

Meti
31-07-2008, 05:19 PM
"The only way i get them into place is to have this CSS:"
Do it then.

Excellent
31-07-2008, 05:22 PM
float:left;

Swinkid
31-07-2008, 06:44 PM
Do it then.

I ment only by aligning them to the left. sorry.


float:left;
Well spotted, typed out wrong, but even if i done that it still wouldn't align propley.

Excellent
31-07-2008, 06:49 PM
How about changing the container width to 800px; instead of x-pixels?

Swinkid
31-07-2008, 06:50 PM
How about changing the container width to 800px; instead of x-pixels?
That done the trick, thank you + rep.

Excellent
31-07-2008, 07:03 PM
No problem :) Any other help just PM me.

Want to hide these adverts? Register an account for free!