treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] CSS Animate Under Floating Element

  • 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!

  • 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.

  • Ahh I was missing position:relative. Thanks!