onclick="myFunction()"
<button id="btnc" class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation" onclick="myFunction()">
<span class="navbar-toggler-icon"></span>
</button>
function myFunction() {
var element = document.getElementById("bars");
element.classList.toggle("snos");
}
<div class="wrapper">
<div class="item item-1">item-1</div>
<div class="item item-2">item-2</div>
<div class="item item-3">item-3</div>
<div id="block" class="item item-4 wrapper-2">
<div class="item">item-4-1</div>
</div>
<div class="item item-5">item-5</div>
<div class="item item-6">item-6</div>
</div>
*
{
margin: 0;
padding: 0;
}
.wrapper
{
display: -ms-grid;
display: grid;
-ms-grid-columns: 1fr 15px 1fr 15px 1fr;
grid-template-columns: 1fr 1fr 1fr;
-ms-grid-rows: 1fr 15px 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr;
grid-column-gap: 15px;
grid-row-gap: 15px;
}
.wrapper-2
{
-ms-grid-columns: 1fr;
grid-template-columns: 1fr;
}
#block
{
display: flex;
flex-direction: row;
justify-content: center;
}
.wrapper-2 > .item
{
background: red;
-ms-grid-column-align: center;
justify-self: center;
margin-top: auto;
margin-bottom: auto;
}
.wrapper > .item
{
background: #cfcfff;
padding: 15px;
}
.wrapper > .item-1
{
-ms-grid-column: 1;
-ms-grid-column-span: 1;
grid-column: 1 span 1;
-ms-grid-row: 1;
-ms-grid-row-span: 1;
grid-row: 1 / span 1;
}
.wrapper > .item-2
{
-ms-grid-column: 3;
-ms-grid-column-span: 1;
grid-column: 2 span 1;
-ms-grid-row: 1;
-ms-grid-row-span: 1;
grid-row: 1 / span 1;
}
.wrapper > .item-3
{
-ms-grid-column: 5;
-ms-grid-column-span: 1;
grid-column: 3 span 1;
-ms-grid-row: 1;
-ms-grid-row-span: 1;
grid-row: 1 / span 1;
}
.wrapper > .item-4
{
-ms-grid-column: 1;
-ms-grid-column-span: 1;
grid-column: 1 span 1;
-ms-grid-row: 3;
-ms-grid-row-span: 2;
grid-row: 2 / span 2;
}
.wrapper > .item-5
{
-ms-grid-column: 3;
-ms-grid-column-span: 1;
grid-column: 2 span 1;
-ms-grid-row: 3;
-ms-grid-row-span: 2;
grid-row: 2 / span 1;
}
.wrapper > .item-6
{
-ms-grid-column: 5;
-ms-grid-column-span: 1;
grid-column: 3 span 1;
-ms-grid-row: 3;
-ms-grid-row-span: 2;
grid-row: 2 / span 1;
}
.wrapper > .item:nth-child(odd)
{
background: #cff1ff;
}