How to add 4 Responsive Columns for Magneto 2?

Mobile first, then desktop. Usually, we use the  following breakpoints:

// X-Small devices (portrait phones, less than 576px)
// No media query for `xs` since this is the default in Bootstrap

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { … }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { … }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) { … }

// X-Large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { … }

// XX-Large devices (larger desktops, 1400px and up)
@media (min-width: 1400px) { … }

Next, we only consider mobile and desktop, I will share the code with you.

 

<style>
* {
box-sizing: border-box;
}
.flex-container {
flex-direction: column;
}

.flex-container ul {
list-style-type: none;
margin: 0;
padding: 0;
}

.flex-container li {
padding: 0;
margin-bottom: 7px;

}

.flex-container {
flex-direction: column;
}

@media (min-width: 768px) {

.flex-container {
display: flex;
flex-direction: row;
text-align: left;
}

.flex-item{
align-self: start;
flex: 25%;
}
}
</style>

<div class=”flex-container”>
<div class=”flex-item”>
<h3><a href=”https://www.optical4u.com/prescription-glasses”>Prescription Glasses</a></h3>
<ul>
<li><a href=”https://www.optical4u.com/cheap-glasses”>Cheap Glasses</a></li>
<li><a href=”https://www.optical4u.com/discount-glasses”>Discount Glasses</a></li>
<li><a href=”https://www.optical4u.com/mens-glasses”>Men’s Glasses</a></li>
<li><a href=”https://www.optical4u.com/womens-glasses”>Women’s Glasses</a></li>
<li><a href=”https://www.optical4u.com/kids-glasses”>Kids Glasses</a></li>
<li><a href=”https://www.optical4u.com/rimless-glasses”>Rimless Glasses</a></li>
<li><a href=”https://www.optical4u.com/aviator-glasses”>Aviator Glasses</a></li>
<li><a href=”https://www.optical4u.com/cat-eye-glasses”>Cat Eye Glasses</a></li>
</ul>
</div>
<div class=”flex-item”>
<h3><a href=”https://www.optical4u.com/prescription-sunglasses”>Prescription Sunglasses</a></h3>
<ul>
<li><a href=”https://www.optical4u.com/sunglasses-for-men”>Sunglasses for Men</a></li>
<li><a href=”https://www.optical4u.com/sunglasses-for-women”>Sunglasses for Women</a></li>
<li><a href=”https://www.optical4u.com/clip-on-glasses”>Clip On Glasses</a></li>
<li><a href=”https://www.optical4u.com/polarized-sunglasses”>Polarized Sunglasses</a></li>
<li><a href=”https://www.optical4u.com/aviator-sunglasses”>Aviator Sunglasses</a></li>
<li><a href=”https://www.optical4u.com/cheap-sunglasses”>Cheap Sunglasses</a></li>
<li><a href=”https://www.optical4u.com/black-sunglasses”>Black Sunglasses</a></li>
<li><a href=”https://www.optical4u.com/cat-eye-sunglasses”>Cat Eye Sunglasses</a></li>
<li><a href=”https://www.optical4u.com/round-sunglasses”>Round Sunglasses</a></li>
</ul>
</div>
<div class=”flex-item”>
<h3><a href=”https://www.optical4u.com/prescription-safety-glasses”>Safety Glasses</a></h3>
<ul>
<li><a href=”https://www.optical4u.com/night-driving-glasses”>Night Driving Glasses</a></li>
<li><a href=”https://www.optical4u.com/prescription-safety-goggles”>Prescription Safety Goggles</a></li>
<li><a href=”https://www.optical4u.com/swimming-goggles”>Swimming Goggles</a></li>
<li><a href=”https://www.optical4u.com/prescription-sports-glasses”>Prescription Sports Glasses</a></li>
<li><a href=”https://www.optical4u.com/prescription-sports-goggles”>Prescription Sports Goggles</a></li>
<li><a href=”https://www.optical4u.com/prescription-sports-sunglasses”>Prescription Sports Sunglasses</a></li>
</ul>
</div>
<div class=”flex-item”>
<h3><a href=”https://www.optical4u.com/prescription-eyeglasses”>Prescription Eyeglasses</a></h3>
<ul>
<li><a href=”https://www.optical4u.com/blue-blocker-glasses”>Blue Blocker Glasses</a></li>
<li><a href=”https://www.optical4u.com/bifocal-glasses”>Bifocal Glasses</a></li>
<li><a href=”https://www.optical4u.com/progressive-glasses”>Progressive Glasses</a></li>
<li><a href=”https://www.optical4u.com/computer-glasses”>Computer Glasses</a></li>
<li><a href=”https://www.optical4u.com/gaming-glasses”>Gaming Glasses</a></li>
<li><a href=”https://www.optical4u.com/tortoise-shell-glasses”>Tortoise Shell Glasses</a></li>
<li><a href=”https://www.optical4u.com/round-glasses”>Round Glasses</a></li>
<li><a href=”https://www.optical4u.com/clear-glasses”>Clear Glasses</a></li>
<li><a href=”https://www.optical4u.com/black-glasses”>Black Glasses</a></li>
</ul>
</div>
</div>