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

Absolute Positioning Problem

Hey guys,

I'm having a little problem with absolute positioning.

Basically I have a div and I want a tab (in this example I've just made a red background div) to sit on the bottom right edge of the main div. The only problem is, if I put more text into the main div to move it past it's min-height the tab does no longer goto the bottom.

Here's a code pen, anyone have any ideas?

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

Thanks!

Ben

2 Answers

The reason your red box is in such an odd position is because you have a min-height on the main container (which also has a relative position) that it resides in and that is where the red box is positioning absolutely to (to the bottom of the min-height). Put the red box inside the about box (not the main container) and it will sit at the very bottom of the div.

See this jsfiddle; http://jsfiddle.net/7M8YE/1/

Thanks Paul!

Hi Ben, Paul is spot on about relocating the about tab. If your find out that your tabs are constrained to its new parent, you can make it pop out by just changing the tab positioning value: bottom: 10px; right: -20px; if this is the desired result you are aiming for. Hope this helps.

Thanks Thai, I changed the positioning value to make Paul's fix work :)