Centering Div Content

Hello,

This is my first post to sitepoint and I’m new to CSS. I’m hoping for a little help in solving what I’m sure is a simple problem. I’m trying to center the content of a div to the browser. The width of the div is large, but I’m just trying to get the content to adjust. I read tutorials and it seemed most of them said to text-align:center the body and then align left the content div, but that doesn’t seem to work for me. So was just looking for insight, this is a exercise for class and getting frustrated. Thank you for any help you can give.

http://tinyurl.com/6myzl79

On your #wrapper selector i simply just changed

text-align: left

to

text-align: center

and it worked fine for me.

That does center, but if the browser is smaller than the width, I get the horizontal scroll. I’m trying to get the content to adjust to the browser window.

The reason you get the horizontal scrollbar is because you have a width which is way too wide for screens that support 990px and below, to support these sizes see the below example which makes use of the min and max width properties.

#wrapper {
    max-width: 1366px;
    min-width: 72%;
    text-align: center;
}