View Full Version : Centering content on page using CSS

06-09-2009, 04:47 PM
I am a very novice CSS user who does not know how to manipulate code. A screenshot of the webpage that I am working on is attached. If you notice, the logo and page title sit above what will eventually be a flash slideshow. I am trying to get the page such that the information in the center is always centered on the screen, no matter what screen resolution is used. From there, I would like both green side bars to extend outwards as far as they need to go to fill the remainder of the screen. I copied and pasted my current code to a text file that also attached. I found a tuturial on the forum reffering to how to do this using code, but I don't know where I need to place the modified code, etc. Please help. Thanks.

06-10-2009, 12:44 AM
search the forum, wrapper divs

06-10-2009, 11:31 PM
create a wrapper div n then create a new css rule for that div. call it whatever you like, click ok, CSS Rule Definition > Category: Box > margin Right:auto and margin left:auto. Be warned if any of the divs holding your content are floated then your wrapper div will not align centre.

06-11-2009, 01:49 PM
You'll also need to set a width for your wrapper div. Whether the content inside the wrapper is floated shouldn't affect the centering of the wrapper.