PDA

View Full Version : Centered Content with CSS layout request


KJHawkins
12-30-2007, 05:35 PM
I am trying to create my web pages in a "rigid" method as shown in the tutorial on this site: http://www.dreamweaverclub.com/css-center-content.php
so that my site centres regardless of which browser or browser size it is viewed in and am having a few difficulties. Would someone be able to attach a layout of where this code should be placed exactly please. I have tried placing it in what seems to be the right area but it still doesn't work so I must be spacing it incorrectly or something. To see a basic page someone has created with this included would make it much clearer to me and I can then build my page accordingly.

Either a Dreamweaver file attached or all the code from a standard "rigid" page posted would be very much appreciated.

Cary
12-30-2007, 08:17 PM
You may have things right, but the wrapper also needs a width which is missing from that tutorial.

So if your content needs a wrapper that is 770px wide you would have this styling:

body {
text-align : center ;
min-width : 770px ;
}
div.wrapper {
width:770px;
text-align : left ;
margin-left : auto ;
margin-right : auto ;
}

domedia
12-30-2007, 08:21 PM
Thanks Cary, I'll let the tutorial writer know about this so we can get an update!

KJHawkins
01-05-2008, 12:54 PM
That's great, many thanks again for you help.