Last active
December 12, 2019 15:45
-
-
Save vosidiy/290acfe374d418859afc00a6b4860281 to your computer and use it in GitHub Desktop.
Overlay onclick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav class="navbar navbar-expand-lg navbar-dark bg-primary"> | |
<a class="navbar-brand" href="#">Brand</a> | |
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main_nav"> | |
<span class="navbar-toggler-icon"></span> | |
</button> | |
<div class="collapse navbar-collapse" id="main_nav"> | |
<ul class="navbar-nav"> | |
<li class="nav-item active"> <a class="nav-link" href="#">Home </a> </li> | |
<li class="nav-item"><a class="nav-link" href="#"> About </a></li> | |
<li class="nav-item"><a class="nav-link" href="#"> Services </a></li> | |
<li class="nav-item dropdown"> | |
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown"> More items </a> | |
<ul class="dropdown-menu"> | |
<li><a class="dropdown-item" href="#"> Submenu item 1</a></li> | |
<li><a class="dropdown-item" href="#"> Submenu item 2 </a></li> | |
<li><a class="dropdown-item" href="#"> Submenu item 3</a></li> | |
<li><a class="dropdown-item" href="#"> Submenu item 4 </a></li> | |
</ul> | |
</li> | |
</ul> | |
</div> <!-- navbar-collapse.// --> | |
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media all and (min-width:991px) { | |
.dropdown:after{ | |
content: ''; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
transition: opacity .15s ease-in-out; | |
opacity: 0; | |
visibility:hidden; | |
background-color: rgba(0,0,0,.7); | |
pointer-events: none; | |
} | |
.dropdown.show .nav-link{ | |
position:relative; | |
z-index:12; | |
} | |
.dropdown.show:after{ | |
z-index:10; opacity:1; | |
visibility:visible; | |
position: fixed; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment