<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 ---------->
<!-- GRID SYSTEM - HTML -->
<!-- Grid System: Settings -->
<div class="grid-settings">
<div class="card">
<div class="card-header">Grid System Settings</div>
<div class="card-body">
<p class="card-text mb-2">Grid options:</p>
<a href="#" id="show-grid" class="btn btn-block btn-sm btn-danger mb-0" type="submit">Hide Grid</a>
<a href="#" id="show-gutters" class="btn btn-block btn-sm btn-danger mb-2">Remove Gutter</a>
<a href="#" id="grid-theme" class="btn btn-block btn-sm btn-dark mb-2">Grid Dark</a>
<p class="card-text mb-2">Container option:</p>
<a href="#" id="change-container" class="btn btn-block btn-sm btn-primary mb-2" type="submit">Container Size</a>
</div>
</div>
</div>
<!-- Grid System: Grids -->
<div class="container grid-system">
<div class="row">
<div class="col-1">
<div class="col-div">1</div>
</div>
<div class="col-1">
<div class="col-div">2</div>
</div>
<div class="col-1">
<div class="col-div">3</div>
</div>
<div class="col-1">
<div class="col-div">4</div>
</div>
<div class="col-1">
<div class="col-div">5</div>
</div>
<div class="col-1">
<div class="col-div">6</div>
</div>
<div class="col-1">
<div class="col-div">7</div>
</div>
<div class="col-1">
<div class="col-div">8</div>
</div>
<div class="col-1">
<div class="col-div">9</div>
</div>
<div class="col-1">
<div class="col-div">10</div>
</div>
<div class="col-1">
<div class="col-div">11</div>
</div>
<div class="col-1">
<div class="col-div">12</div>
</div>
</div>
</div>
<!-- YOUN WON'T NEED ANY OF THESE BELOW: -->
<!-- Navbar -->
<nav class="navbar navbar-light bg-light px-0">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="https://getbootstrap.com/docs/4.3/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top mr-3" alt="">Grid4BS
</a>
<span class="navbar-text">
A visible grid system for Bootstrap
</span>
</div>
</nav>
<main role="main">
<!-- Jumbotron -->
<div class="jumbotron px-0">
<div class="container">
<h1 class="display-3">Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more »</a></p>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.</p>
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
</div>
</div>
<hr>
</div> <!-- /container -->
</main>
<footer class="container">
<p>© Company 2017-2019</p>
</footer>
/* GRID SYSTEM - CSS */
/* Grid System: Settings */
.grid-settings {
position: fixed;
width: 200px;
top: 80px;
right: 20px;
z-index: 9999;
}
/* Grid System: Grids */
.grid-system {
text-align: center;
position: fixed;
right: 0;
left: 0;
margin-right: auto;
margin-left: auto;
height: 100vh;
z-index: 1;
visibility: visible;
}
.grid-system div[class^="col-"] {
border-left: 1px dotted rgba(0, 0, 0, 0.2);
height: 100vh;
}
.grid-system div[class^="col-"]:last-child {
border-right: 1px dotted rgba(0, 0, 0, 0.2);
}
.grid-system .col-div {
background-color: rgba(0, 0, 0, 0.025);
border: none !important;
padding-top: 15px;
color: rgba(0, 0, 0, 0.3);
}
/* Grid System: Light Theme */
.grid-system.light .col-div {
background-color: rgba(255, 255, 255, 0.025);
color: rgba(255, 255, 255, 0.3);
}
.grid-system.light div[class^="col-"],
.grid-system.light div[class^="col-"]:last-child {
border-color: rgba(255, 255, 255, 0.2);
}
/* FOR DEMO PURPOSES ONLY: */
.bg-dark h1,
.bg-dark h2 {
color: #fff;
}
.bg-dark p {
color: rgba(255, 255, 255, .5);
}
.grid-settings .card-body p {
color: #212529;;
}
/* GRID SYSTEM - JS */
// Show - Hide Grid
$( '#show-grid' ).click(function() {
$( ".grid-system" ).toggleClass( "invisible" );
$( this ).toggleClass( "btn-danger" ).addClass( "btn-success" );
$(this).text(function(i, text){
return text === "Show Grid" ? "Hide Grid" : "Show Grid";
})
});
// Add - Remove Gutters
$( '#show-gutters' ).click(function() {
$( this ).toggleClass( "btn-danger" ).addClass( "btn-success" );
if ($( ".row" ).hasClass( "no-gutters" ) == true) {
$( ".row" ).removeClass( "no-gutters" );
$( this ).html( "Remove Gutter" );
}
else if ($( ".row" ).hasClass( "no-gutters" ) == false) {
$( ".row" ).addClass( "no-gutters" );
$( this ).html( "Add Gutter" );
}
});
// Dark - Light Grid Theme
$( '#grid-theme' ).click(function() {
$( ".grid-system" ).toggleClass( "light" );
// THESE LINES ARE:
$( ".navbar" ).toggleClass( "bg-dark" );
$( ".navbar" ).toggleClass( "navbar-dark" );
$( ".jumbotron" ).toggleClass( "bg-dark" );
$( "body" ).toggleClass( "bg-dark" );
// FOR DEMO PURPOSES ONLY!
$( this ).toggleClass( "btn-dark" ).addClass( "btn-light" );
$(this).text(function(i, text){
return text === "Grid Light" ? "Grid Dark" : "Grid Light";
})
});
// Change Container Size
$( '#change-container' ).click(function() {
if ($( ".container" )[0]){
$( ".container" ).removeClass( "container" ).addClass( "container-fluid" );
}
else if ($( ".container-fluid" )[0]){
$( ".container-fluid" ).removeClass( "container-fluid" ).addClass( "container");
}
});