"Grid- Gap"
Bootstrap 4.1.1 Snippet by yui.napassorn

<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 ----------> <div class="container"> <h2> Grid- Gap 1</h2> <div class="grid-container"> <div class="grid-item">1</div> <div class="grid-item">2</div> <div class="grid-item">3</div> <div class="grid-item">4</div> <div class="grid-item">5</div> <div class="grid-item">6</div> <div class="grid-item">7</div> <div class="grid-item">8</div> <div class="grid-item">9</div> </div> <br/> <h2> Grid- Gap 2</h2> <div class="grid-container2"> <div class="grid-item2">1</div> <div class="grid-item2">2</div> <div class="grid-item2">3</div> <div class="grid-item2">4</div> <div class="grid-item2">5</div> <div class="grid-item2">6</div> <div class="grid-item2">7</div> <div class="grid-item2">8</div> </div> </div>
body{margin-top: 100px; margin-bottom: 100px;} .grid-container { display: grid; grid-gap: 50px 100px; grid-template-columns: auto auto auto; background-color: #2196F3; padding: 10px; } .grid-item { background-color: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.8); padding: 20px; font-size: 30px; text-align: center; } .grid-container2 { display: grid; grid-gap: 50px 100px; grid-template-columns: auto auto auto auto; background-color: #2196F3; padding: 10px; } .grid-item2 { background-color: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.8); padding: 20px; font-size: 30px; text-align: center; }

Related: See More


Questions / Comments: