CSS:
.nav {
width: 15%;
height: 800px;
background-color: #421;
margin-top: 55px;
float: left;
}
.nav-min {
width: 5% !important;
background-color: #ccc !important;
}
JS:
<script src="http://code.jquery.com/jquery-2.2.3.min.js"></script><scripttype="text/javascript">
$('#btn').click(function() {
$('.nav').toggleClass('nav-min');
});
</script>
HTML:
<nav class="nav">
<button class="btn btn-menu" id="btn">Menu</button>
</nav>
Here are tests that I did and they worked link
But it did not run on localhost, does anyone know what it might be? I've already checked if it's saving, but it still does not work at all.