Hacker News new | ask | show | jobs
by dawgr 5641 days ago
I read somewhere recently that most sites are using central layout now as opposed to fixed or liquid. I was looking for tutorials but I didn't find any, how would I go about making a central layout?
1 comments

you just need a container, make the width of it about 980px and set the margin like so: #page_container {margin:0px auto;}
Alright thank you. Just one last question, within that 980px space, would the design be liquid or fixed? Maybe it sounds stupid but I'm kind of new to CSS.
That would be fixed then, you can subdivide that 980px space into columns but nothing inside will stretch beyond the boundaries. Eg. here's one of our sites: http://nxbus.co.uk

You can see that while there's a background image on the full page, all of the content is constrained to a 962px width container with the auto margins. This keeps it centred but with a fixed width.

Alright, thank you.