tylertate / semantic.gs

The Semantic CSS Grid
tylertate.github.io/semantic.gs/
Apache License 2.0
1.59k stars 245 forks source link

How to center an 80% fluid layout #92

Closed shillo92 closed 11 years ago

shillo92 commented 11 years ago

Hi,

I have a website which uses the semantic.gs fluid layout, however I didn't set the total-width variable to 100% but to 80%, now I'm trying to find a way to center my content so it won't float to the left side of the document. I tried centering using a container div and setting it a margin: 0 auto but it doesn't work. If you didn't understand me quite well maybe this fiddle I made will help you out: http://jsfiddle.net/28wHe/3/

tylertate commented 11 years ago

Hi,

In order to use margin: 0 auto to center something, the element must have a defined width. So if you added width: 80%; to the #container element in your fiddle, that should center it.

Tyler

shillo92 commented 11 years ago

Hi Taylor,

thank you very much! My whole layout was improved, I now understand how to create a fixed responsive layout,