Questions? 866-530-4804
Home    Blog    Contact    About

Subscribe Gibber-gabber
CSS relative absolute positioning
Jason Scragz 2008-09-10 06:36:27 UTC

A couple weeks ago, while doing some unrelated research, I came across a technique that I had somehow never heard of for absolute positioning in CSS. I want to post it here in case anyone else has missed out on this one.

There have been quite a few times where I wanted a div to be positioned absolutely and to have it’s top/left/etc. to be specified from its staticly-positioned parent, and not from the viewport. It turns out that all you need to do is give the parent position: relative and you can do exactly that.

Here’s the original article I read that goes in way more depth.

© 2007-2012 CoTradeCo, Coachella Valley Packaging, & Coachella Valley Trading Company
are part of the Shorebird Corporation

Community content is all rights reserved © by the contibutor of that content granting
CoTradeCo some limited non-exclusive usage rights, see our policies.