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

Stacking three elements on top of each to other centred in a div.

Hello, i've been doing pretty well with my site so far and i'm now at a frustrating point where i think i am messing up my code trying to solve this problem.

I have three circles in a div, each circle is slightly larger than the other.

<div class="nav"> <div class="circle"></div> <div class="circle2"></div> <div class="circle3"></div> </div>

What i would like to do is 1st. Center all of them horizontal and vertically in the containing "nav" div. which has a width: 100%; height: 400px;

2nd i want to stack each of the circles on top of each other so you get a small circle centred within a large circle, which is in turn centred within a larger circle.

Please help, this is driving me loopy!

Thank You solo much!

Ross

1 Answer

Exactly like that!!

You are a legend Christian Thank you so much

Glad I could help :)