Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"bootstrap 4 sidenav "
Bootstrap 4.1.1 Snippet by
Swarajn
4.1.1
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
612
 
0 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script> <div id="mySidenav" class="sidenav text-white" style="width:250px;"> <a class="closebtn sidenav-close">×</a> <div class="bg-warning text-dark p-2"> <div class='text-center' style="color:#b3b3b3;"> <span class='fa fa-user-circle fa-4x mb-2'></span> </div> <h4 class='text-center'>Hi, User</h4> <span class='ml-2'> Log in on : 20:09:43 </span> </div> <a><i class='fa fa-user'></i> User</a> <a><i class='fa fa-clock-o'></i> <span id="countdown">02:00:00</span></a> <a onclick="$(this).find('.collapse-icon').toggleClass('fa-rotate-90');" data-toggle="collapse" data-target='#my-account'> My Account <span class='fa fa-chevron-right float-right m-1 collapse-icon'></span> </a> <div class="collapse inner-menu" id='my-account'> <a class="menu-link border-menu-light" href="#"><i class='fa fa-user'></i> My Account</a> <a class="menu-link border-menu-light" href="#"><i class='fa fa-key'></i> Change password</a> </div> <a class="text-danger" href='#'><i class='fa fa-power-off'></i> Log out</a> </div> <div class="bg-dark text-center sidebar mt-4 mt-md-0" style="position:absolute;"> <span class="fa fa-bars"></span> <span class="fa fa-user"></span> <span class="fa fa-clock-o"></span> <a class="text-danger fa fa-power-off" href='#'></a> </div> <div class="fixed-bottom text-white bg-navy pl-2"> <i class='fa fa-sign-in-alt'></i> User</i> </div>
.sidebar span{ color:#fff; } .sidebar span:hover{ color:#ffff80; } .sidenav { height: 100%; width: 250px; position: fixed; z-index: 9999; top: 0; left: 0; background: #1a1a1a; overflow-x: hidden; transition: 0.5s; padding-top: 60px; } .sidenav a { padding: 8px 8px 8px 32px; text-decoration: none; color: #ccc; display: block; transition: 0.3s; } .sidenav a:not(.menu-link){ font-size: 23px; } .sidenav a:hover { color: #f1f1f1; }.sidenav .fa-chevron-right{ transition:all 0.6s; } .sidenav .closebtn { position: absolute; top: 0; right: 25px; font-size: 36px; margin-left: 50px; } .sidebar{ font-size:20px; width: 40px; border-radius: 4px; border-top-left-radius: 0; border-bottom-left-radius: 0; cursor:pointer; position: absolute; } .sidenav .collapse-icon{ font-size: 19px; } .menu-link{ font-size: 18px; } .border-menu-light{ border:1px solid #ccc; border-top: 0; border-left: 0; border-right: 0; } .border-menu-light:not(.border-menu-light:last-child):hover{ border:1px solid #fff; border-top: 0; border-left: 0; border-right: 0; } .border-menu-light:last-child{ border-bottom: 0; } @media screen and (max-height: 450px) { .sidenav .closebtn{color: #000;} .sidenav .closebtn:hover{color: #000;} } @media screen and (max-height: 450px) { .sidenav {padding-top: 15px;} .sidenav a {font-size: 18px;} }
$("#mySidenav").css({left:"-250px"}); $('.sidebar span, .sidebar a').click(function(){ $("#mySidenav").css({left:"0px"}); }).addClass('p-2'); $('.sidenav-close').click(function(){ $("#mySidenav").css({left:"-250px"}); });
Related:
See More
Free Template
Get Shit Done Kit
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76