0

using o.v's solution ("You don't even need javascript to do this!") from this thread

i am able to successfully get background images in a dropdown box. however, it always appear under other html elements. see here here

changing the z-index doesn't help.

any suggestions ?

(sorry for the duplicate but my reputation doesn't allow me to post on that thread)

Community
  • 1
  • 1
buzibuzi
  • 724
  • 3
  • 15
  • 27
  • 1
    Your link isn't working – Itay Sep 01 '13 at 07:46
  • I can't really understand what background-image are you referring and where do you want it to be. Consider adding pictures of the wanted result. – Itay Sep 01 '13 at 10:02
  • talking about dropdown background colors for each text. read the thread i referred to. anyway, a solution was given by koala_dev. thanks for your help – buzibuzi Sep 01 '13 at 11:44

1 Answers1

2

z-index only works on positioned elements (position:absolute, position:relative, or position:fixed) so you just need to add this to your CSS:

#image-dropdown {
    z-index: 3;
    position: relative;
}

Also it's bad practice to just use a large number for the z-index in an effort to bring it forward, in your case some of your links have z-index:2 so setting the value to 3 for the dropdown will suffice

omma2289
  • 54,161
  • 8
  • 64
  • 68