-1

I have this elements:

#first {background-color: red; position: fixed}
#second {background-color: green; opacity: 50%}
<div id="first">first</div>
<div id="second">second</div>

but first element getting behind of second element.

zoldxk
  • 2,632
  • 1
  • 7
  • 29
bahoz99
  • 121
  • 1
  • 6
  • 1
    Does this answer your question? [How to make div appear in front of another?](https://stackoverflow.com/questions/5480639/how-to-make-div-appear-in-front-of-another) – Osadhi Virochana Apr 18 '21 at 15:07

1 Answers1

1

Try this:

#first {
  background-color: red;
  position: fixed;
  z-index: 10;
}
r1ddler
  • 178
  • 6