Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: not2easy
I have my content in div tags. Each div has a width of 800px. I need to center each div in the page. How is this possible? Whenever I add text-align: center; to the CSS body it just centers the text in the divs and not the actual divs themselves.
Does anyone know a work around for this?
Thanks in advance for your help!
In this example, the div with the id of "container" is what we want to make centered and fixed width. Now for the CSS:
margin: 0 auto;
border: 1px solid red;
You could omit the margin and border on the body element if you wanted. Also, the border on the container is just to show where it is in this example. You would probably want to add text-align: left; to your container rules.