Home > Software design >  Why the picture displays on sticky header?
Why the picture displays on sticky header?

Time:05-01

The picture is on header while scrolling but it should be "under it" like some other navs do. Website

The picture:

.nav3{
float:right;
height:820px;
margin:2px; }


.waterfall {
position: relative;
left:-20%; bottom: 100%; }

<nav >
<img  src="../Szablony 3/wodospad.jpg">
</nav>

The sticky element:

 <header id="header1">

#header1 {
height: 50px;
width: 100%;
background-color:black;
position:sticky ;
top: 0;

CodePudding user response:

Set z-index on navbar to something high.

#header1 {
height: 50px;
width: 100%;
background-color:black;
position:sticky ;
top: 0;
z-index: 1000;
}
  • Related