0

Straight to the point. The CSS ribbon is supposed to attach itself to the right sidebar div, but it keeps attaching itself to the left one for reasons unknown to me. I've tried pretty much everything but can't figure it out. This must be really easy to someone with a higher understanding of CSS ..so..

Here is the code: http://jsfiddle.net/pcpEK/ And the full preview: http://jsfiddle.net/pcpEK/embedded/result/

Any help is greatly appreciated :)

1 Answer 1

0

Add position: relative and padding-top to -

#sidebar {
        float:right;
        width:220px;
        padding:90px 0 0 0;
        position: relative;
    }

Since you have given position: absolute to #ribbon its parent needs to have relative position, because the top and left position of absolute element starts from its parent element which has position: relative.

If the parent element doesn't have relative position the absolute positioned element takes its position from body

DEMO: http://jsfiddle.net/pcpEK/2/

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.