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

              
                

<!--menu side bar-->


<div class="overlay"></div>
<div class="container">
  <div class="col-sm-3 col-md-3">
    <nav id="sidebar">

                <div class="sidebar-header">
                    <h3>Bootstrap Sidebar</h3>
                </div>

                <ul class="list-unstyled components">
                    <!--<p>Dummy Heading</p>-->
                    <li class="active">
                        <a href="#homeSubmenu" data-toggle="collapse" aria-expanded="false">Home</a>
                        <ul class="collapse list-unstyled" id="homeSubmenu">
                            <li><a href="#">Home 1</a></li>
                            <li class="active"><a href="#">Home 2</a></li>
                            <li><a href="#">Home 3</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">About</a>
                        <a href="#pageSubmenu" data-toggle="collapse" aria-expanded="false">Pages</a>
                        <ul class="collapse list-unstyled" id="pageSubmenu">
                            <li><a href="#">Page 1</a></li>
                            <li><a href="#">Page 2</a></li>
                            <li><a href="#">Page 3</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">Portfolio</a>
                    </li>
                    <li>
                        <a href="#">Contact</a>
                    </li>
                </ul>

                
            </nav>

  </div>
  <div class="col-sm-9 col-md-9">
 

                <nav class="navbar navbar-default">
                    <div class="container-fluid">

                        <div class="navbar-header">
                          <button type="button" id="sidebarCollapse" class="btn btn-info navbar-btn active">
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                        </div>

                        
                    </div>
                </nav>

  

  </div>
</div>


              
            
!

CSS

              
                #sidebar a, #sidebar a:hover, #sidebar a:focus {
    color: #1d2129;
    text-decoration: none;
    transition: all 0.3s;
}
/* ---------------------------------------------------
    SIDEBAR STYLE
----------------------------------------------------- */
#sidebar {
	color: #1d2129;
}

.overlay {
	position: fixed;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.7);
	z-index: 998;
	display: none;
}

#sidebar .sidebar-header {
	display: none;
}

#sidebar ul li a {
	padding: 10px;
	font-size: 1.1em;
	display: block;
	border-left: 3px solid #e9ebee;
}

#sidebar ul li a:hover {
	border-left: 3px solid #009688;
	color: #1d2129;
	background: #fff;
}

#sidebar ul li.active>a, a[aria-expanded="true"] {
	border-left: 3px solid #009688;
	color: #1d2129;
	background-color: #fff;
}

#sidebar ul li .active>a {
	color: #009688;
}

a[data-toggle="collapse"] {
	position: relative;
}

a[aria-expanded="false"]::before, a[aria-expanded="true"]::before {
	content: '\e259';
	display: block;
	position: absolute;
	right: 20px;
	font-family: 'Glyphicons Halflings';
	font-size: 0.6em;
}

a[aria-expanded="true"]::before {
	content: '\e260';
}

ul ul a {
	font-size: 0.9em !important;
	padding-left: 30px !important;
}

/*Botao menu sidebar*/
#sidebarCollapse {
	display: none;
}
/* ---------------------------------------------------
    MEDIAQUERIES
----------------------------------------------------- */
@media ( max-width : 768px) {
  #sidebar a {
    color: #fff;
  }
  #sidebar ul li.active>a, a[aria-expanded="true"] {
	color: #1d2129 !important;
	background-color: #fff;
}
	#sidebar {
		margin-left: -250px;
		width: 250px;
		color: #fff;
		background: #009688;
		overflow-y: scroll;
		box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.2);
		position: fixed;
		top: 0;
		left: -250px;
		height: 100vh;
		z-index: 999;
	}
	#sidebar.active {
		margin-left: 0;
		left: 0;
	}
	#sidebar .sidebar-header {
		display: block;
		padding: 20px;
	}
	#sidebar ul li a, #sidebar ul li a:hover, #sidebar ul li.active>a, a[aria-expanded="true"]
		{
		border-left: none;
	}

	/*Botao menu sidebar*/
	#sidebarCollapse {
		display: inline-block;
		width: 44px;
		height: 34px;
		padding: 9px 10px;
		background: #f5f5f5;
		margin-left: 15px;
	}
	#sidebarCollapse span {
		width: 22px;
		height: 2px;
		border-radius: 1px;
		margin: 0 auto;
		display: block;
		background: #1d2129;
		transition: all 0.8s cubic-bezier(0.810, -0.330, 0.345, 1.375);
		transition-delay: 0.2s;
	}
	#sidebarCollapse span:first-of-type {
		transform: rotate(45deg) translate(2px, 2px);
	}
	#sidebarCollapse span:nth-of-type(2) {
		opacity: 0;
	}
	#sidebarCollapse span:last-of-type {
		transform: rotate(-45deg) translate(1px, -1px);
	}
	#sidebarCollapse.active span {
		transform: none;
		opacity: 1;
	}
	#sidebarCollapse.active .icon-bar+.icon-bar {
		margin-top: 4px;
	}
}


/*retirar*/
body {
	background: #e9ebee;
}
              
            
!

JS

              
                $(document).ready(function () {
                 $("#sidebar").niceScroll({
                     cursorcolor: '#53619d',
                     cursorwidth: 4,
                     cursorborder: 'none'
                 });

                 $('.overlay').on('click', function () {
                    $('#sidebarCollapse').addClass('active');
                    $('#sidebar').removeClass('active');
                    $('.overlay').fadeOut();
                 });

                 $('#sidebarCollapse').on('click', function () {
                    if($(this).hasClass('active')){
                       $(this).removeClass('active');
                       $('#sidebar').addClass('active');
                       $('.overlay').fadeIn();
                       $('.collapse.in').toggleClass('in');
                       $('a[aria-expanded=true]').attr('aria-expanded', 'false');
                    }
                    });
             });

              
            
!
999px

Console