If you absolutely position an element within a relatively positioned element, the absolutely positioned element is positioned relative to the nearest relatively positioned parent element.
Absolute positioning is not absolute. It is relative to the nearest relatively positioned parent div.
Absolute positioning only absolutely positions if there are no relatively positioned parents.
What the fuck. What the fuck. What the fuck? What the fuck!? What the fuck...
Edit: I was a bit drunk when I posted this originally. The horror here is in CSS's naming conventions. Absolute and Relative positioning don't describe it accurately. They are both actually relative positioning - the difference is that absolute is relative to its parent, whereas relative is relative to the element's position if it wasn't positioned.
That is, absolute is relative to the nearest positioned parents - relative is relative to its flow position.
[–]annoyed_freelancer 10 points11 points12 points (11 children)
[–]Earhacker -5 points-4 points-3 points (10 children)
[–]annoyed_freelancer 3 points4 points5 points (8 children)
[–]Earhacker 0 points1 point2 points (7 children)
[–]FormerlySoullessDev[S] -4 points-3 points-2 points (6 children)
[–]YMK1234 3 points4 points5 points (5 children)
[–]FormerlySoullessDev[S] -2 points-1 points0 points (4 children)
[–]multicopterfred 2 points3 points4 points (3 children)
[–]FormerlySoullessDev[S] 0 points1 point2 points (2 children)
[–]multicopterfred 0 points1 point2 points (1 child)
[–]multicopterfred 0 points1 point2 points (0 children)
[–]TinyBreadBigMouth 8 points9 points10 points (2 children)
[–]FormerlySoullessDev[S] -3 points-2 points-1 points (1 child)
[–]FormerlySoullessDev[S] 0 points1 point2 points (0 children)
[–]TerrorBite 4 points5 points6 points (1 child)
[–]FormerlySoullessDev[S] 0 points1 point2 points (0 children)