Skip to content

Instantly share code, notes, and snippets.

@erikhayry
Created November 27, 2019 08:11
Show Gist options
  • Select an option

  • Save erikhayry/3d53e09e2cf703f01aef2b5494cb0120 to your computer and use it in GitHub Desktop.

Select an option

Save erikhayry/3d53e09e2cf703f01aef2b5494cb0120 to your computer and use it in GitHub Desktop.
Dimmer - z
<div class="page">
<ul>
<li>1</li>
<li class="active">2</li>
<li>3</li>
</ul>
<div class="content">
</div>
</div>
<div class="dimmer">
</div>
li{
background-color: red;
margin: 10px;
}
li.active{
position: relative;
z-index: 3;
}
.content{
position: relative;
z-index: 3;
}
.dimmer{
background-color: #000;
opacity: 0.7;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment