Reputation: 118952
When positioning an element relatively, as far as it's parent is concerned, it is still in the position where it would be without the relative declaration. This means that the parent's block doesn't extend to where the objects has been repositioned.
In this example, the light blue/green background around the big picture and "Beach House" text, doesn't extend to the bar below (with Privacy and Like Us, ect.). This is because the bar is positioned using relative. Is there an easy way to extend the rectangle to cover the bottom bar?
Here is a simplified version in jsFiddle.
Upvotes: 0
Views: 79
Reputation: 16177
Why not using a combinaison of float: left; margin: X;
instead of position: relative; top: Xpx; left: Xpx;
View example here http://jsfiddle.net/zpV3m/7/
Upvotes: 1
Reputation: 12619
I assume since you are relying on the html5 tags, I can ignore old IE so I used the css box-sizing property to simplify it, the code and achieve the same effect.
I left the rgb colors even though you really should change them back to the normal hex values to gain IE8 support.
Upvotes: 1