The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS Animate Under Floating Element

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #42435

    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:

    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!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.