Previous Message
Next Message

I can never learn this - how do I center a part of my page

Sent by Zoe M. Gillenwater on 23 November 2005 23:11


Hi Jan,

Jan Erik Moström wrote:

>#pagebody       
>        {
>            background-color: #fbb;
>            width: 500px;       
>        }
>
>but how do I center this part?
>  
>

Just add "margin: 0 auto".  Think of it this way: you want the centered 
item to have equal size margins on each side.  That's what the auto bit 
does for the left and right margins.

Our wiki is an excellent reference for how to perform these sorts of 
basic tasks in CSS.  I recommend checking it first before posting to the 
list.  Searching the list archives via Google will also help you find 
answers to FAQs.
http://css-discuss.incutio.com/?page=SearchCssDiscussList

Zoe

-- 
Zoe M. Gillenwater
Design Services Manager
UNC Highway Safety Research Center
http://www.hsrc.unc.edu

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: