"Flexbox Responsive"
Bootstrap 4.1.1 Snippet by subhash4web

<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="items"> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> <div class="item">Lorem Ipsum</div> </div>
.items { display: flex; flex-wrap: wrap; margin-left: -10px; margin-top: -10px; } .items .item { flex: 1 0 200px; box-sizing: border-box; background: #5aa518; color: #ffffff; text-align:center; padding: 20px; margin-left: 10px; margin-top: 10px; } @media (min-width: 410px) { .items .item { max-width: calc(50% - 10px); } } @media (min-width: 620px) { .items .item { max-width: calc(33.33333% - 10px); } } @media (min-width: 830px) { .items .item { max-width: calc(25% - 10px); } } @media (min-width: 1040px) { .items .item { max-width: calc(20% - 10px); } } @media (min-width: 1250px) { .items .item { max-width: calc(16.66667% - 10px); } } @media (min-width: 1460px) { .items .item { max-width: calc(14.28571% - 10px); } } @media (min-width: 1670px) { .items .item { min-width: calc(12.5% - 10px); } }

Related: See More


Questions / Comments: