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 CSS Foundations The Box Model Positioning Properties

Cheryl Hurley
Cheryl Hurley
2,250 Points

Blocks Moving Differently

I've been playing around with CSS positioning and came across something that doesn't inherently make sense to me.

Here's my codepen: http://codepen.io/anon/pen/kxJdb

What I don't understand is why, though each div box has the same exact positioning attached (bottom: 50px; left: 150px), the "top" and "bottom" div squares mimic one another, while the "middle" div square seems to go totally rogue and do its own thing.

Why is this, and how do I anticipate it in my code?

Thanks.

1 Answer

Cheryl Hurley
Cheryl Hurley
2,250 Points

Nevermind! I see now that I somehow missed that I'd left the "middle" box positioning as absolute. Everything makes a LOT more sense now.