Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- Sidenav -->
      <div class="hide-menu" id="hide-menu">
            <ul class="navbar-nav ml-auto">
              <li class="nav-item active">
                <a href="#">Home <span class="sr-only">(current)</span></a>
              </li>
              <li class="nav-item">
                <a href="#">Features</a>
              </li>
              <li class="nav-item">
                <a href="#">Pricing</a>
              </li>
              
            </ul>   
            <a href="#!" id="link-close" class="btn-close-link"><i class="material-icons close-btn">close</i></a>
        </div>

      <div id="overlay" class="d-none"></div>

<header>
  <div class="container">             
           
               <nav class="navbar navbar-expand-lg navbar-light">
                  <a class="navbar-brand font-weight-bold" href="#!">Bootstrap Menu +  Sidenav</a>
                  <button class="navbar-toggler" type="button" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation" id="menu-button">
                    <i class="fa fa-align-right"></i>
                  </button>
                  <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav ml-auto">
                      <li class="nav-item active">
                        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
                      </li>
                      <li class="nav-item">
                        <a class="nav-link" href="#">Features</a>
                      </li>
                      <li class="nav-item">
                        <a class="nav-link" href="#">Pricing</a>
                      </li>
                      <li class="nav-item">
                        <a class="nav-link disabled" href="#">Disabled</a>
                      </li>
                    </ul>   
                
           </div>
         </nav>
       
    </div>
  </header>

  <div class="content"><h1 class="h3">Resize window to see the sidenav appearing</h1></div>

<script
			  src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
			  integrity="sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8="
			  crossorigin="anonymous"></script>
		
              
            
!

CSS

              
                /* The side navigation menu */
$dark: #222;

header {
  background-color: #F5ECE1;
  width: 100%;
}

.hide-menu
{
    overflow-x: hidden; /* Disable horizontal scroll */
    padding-top: 60px; 
    background-color: $dark;
    position: fixed;
    top:0;
    right:0;
    z-index: 999;
    width: 250px;
    height: 100%;
    -webkit-transform: translate3d(300px,0,0);
    -moz-transform: translate3d(300px,0,0);
    -o-transform: translate3d(300px,0,0);
    -ms-transform: translate3d(300px,0,0);
    transform: translate3d(300px,0,0);      
    -webkit-transition: all 0.3s linear;
    -moz-transition: all 0.3s linear;
    -ms-transition: all 0.3s linear;
    -o-transition: all 0.3s linear;
    transition: all 0.3s linear;
    ul li a {
        padding: 8px 8px 8px 32px;
        text-decoration: none;
        font-size: 25px;
        color: #818181;
        display: block;
    }
    a.btn-close-link {
       color: #818181;
    }
    i.close-btn {
        position: absolute;
        top: 8px;
        right: 25px;
        font-size: 36px;
        margin-left: 50px;
    }
}

.show-menu      
{
    -webkit-transform: translate3d(0,0,0);
    -moz-transform: translate3d(0,0,0);
    -o-transform: translate3d(0,0,0);
    -ms-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
 }

.navbar-toggler {
    height: auto;
    width: auto;
    i {
        font-size: 1.6rem;
        color: #676767;
        
    }
}

#overlay {
  position: fixed; /* Sit on top of the page content */
  //display: none; /* Hidden by default */
  width: 100%; /* Full width (cover the whole page) */
  height: 100%; /* Full height (cover the whole page) */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.49); /* Black background with opacity */
  z-index: 80; /* Specify a stack order in case you're using a different order for other elements */
  cursor: pointer; /* Add a pointer on hover */
    transition: all 0.25s ease-in;
}
              
            
!

JS

              
                //Sidenav
$('#menu-button').click(function(e){
    e.stopPropagation();
     $('#hide-menu').toggleClass('show-menu');
     $('#overlay').removeClass('d-none');
});
$('#hide-menu').click(function(e){
    e.stopPropagation();
});
$('body,html,#link-close').click(function(e){
       $('#hide-menu').removeClass('show-menu');
       $('#overlay').addClass('d-none');
});
              
            
!
999px

Console