PDA

View Full Version : Align a container div



drmac
Jul 1st, 2009, 01:45 PM
Hi!
I want to align my container div 120px to the left from the center, what css code should I use for that?

You can see the homepage at madeleinegaterud dot com/test

abduraooft
Jul 1st, 2009, 02:01 PM
I want to align my container div 120px to the left from the cente Sorry, your intention is not clear. Your container is currently centered with

margin:0 auto;
width:720px; rules. Don't you need to center it anymore?

drmac
Jul 1st, 2009, 02:32 PM
Sorry, your intention is not clear. Your container is currently centered with

margin:0 auto;
width:720px; rules. Don't you need to center it anymore?



I want to move the whole container 60px, to the left, so the picture of the woman is centered in the browser. And then it will look like the menu is in the left margin.

Sorry for bad english and bad explaining.

abduraooft
Jul 1st, 2009, 02:48 PM
Try

div#container {/*css.css (line 17)*/
background-color:#000000;
left:50%;
margin-left:-420px;
position:absolute;
text-align:left;
width:720px;
}

drmac
Jul 1st, 2009, 03:29 PM
Try

div#container {/*css.css (line 17)*/
background-color:#000000;
left:50%;
margin-left:-420px;
position:absolute;
text-align:left;
width:720px;
}

Wonderful! Thanks!!!