Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Daniel Gibson
Daniel Gibson
15,452 Points

Centering nested div's in a grid

I am attempting to build my first responsive website alone, I have used the fluid grid from the Smells like Bakin' example to layout my website.

I am trying to center div's with a div (3 grid_4's within 1 grid_12) I started to use margins and widths but this didn't work so well when resizing the browser, I have tried looking up code and playing around with elements like display and float but nothing I tried has worked for me so far.

I think the problem is that the grid I use floats everything left?

Any help would be great.

You will see what I mean in the 'What I do' and 'Portfolio' section of my website.

http://codepen.io/anon/pen/tlIkK

1 Answer

The circles are not centered because of the padding on the UL.

The lower sections are not centered because it looks like you're using 960 without using an "omega" class to remove the extra space on the final column.