Grow your CSS skills. Land your dream job.

CSS Animate Under Floating Element

  • # February 2, 2013 at 9:42 pm

    Hi all -

    In the header of my site, on the right side, I have a drop down option that let’s you go to other links.

    Here’s an example on CodePen: http://codepen.io/jordangrogan/pen/oDlBC

    My code works when you click on it, and it animates, but it animates OVER the “Choose” div instead of under it. Does that make sense? Is there a way to have the “margin” transition under the “Choose” div?

    Also, is my code the best way to accomplish this. I basically need the “Choose” div on the top, right of the screen – so is float the best way?

    I really appreciate all your help! Thanks!

    # February 2, 2013 at 9:45 pm

    try setting them both to “position:relative;” and then give the “options” div a z-index of 1, and the “choose” div a z-index of 2.

    # February 2, 2013 at 9:57 pm

    Ahh I was missing position:relative. Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".