PDA

View Full Version : Container not centered


Fleiding
04-29-2017, 04:02 PM
I'm using the following CSS in additional.css to create a container around my forum (div opening in header and closing in footer):

#main_container {
width: 1200px;
max-width: 100%;
margin: 0 auto;
overflow: hidden;
background: #FFFFFF;
padding: 10px;
border-left-style:solid;
border-left-width:1px;
border-left-color:#f4f4f4;
border-right-style:solid;
border-right-width:1px;
border-right-color:#f4f4f4;
}

As you can see in this picture (https://i.imgur.com/67Awfef.png) (or forum (https://www.pokemonunited.nl/forum/forum.php)) the container is slightly centered off to the right. I'm using the same CSS without any issues on WordPress. Can anyone help me with centering the container?

Dave
04-29-2017, 05:02 PM
Get rid of the width attribute of the body element and it will center properly.

Fleiding
04-29-2017, 05:11 PM
Thanks, Dave! :)

Dave
04-29-2017, 05:15 PM
No problem. Veel succes met je forum. :)