My layout consists of a row with three columns that adjust sizes based on the screen size. However, I encounter an issue when shrinking the screen, as I only want the margin to change for specific boxes. The following illustrates the appearance with no margin on the left or right.
Screen Size: XL
https://i.sstatic.net/RdBXD.png
Upon scaling down the screen size with no margin, the layout looks like this.
Screen Size: L https://i.sstatic.net/Daj8i.png
When adjusting the margin to "mr-4," the scaling of the boxes does not match. The layout appears with margin on the first and second boxes as shown below.
Screen Size: XL https://i.sstatic.net/4TlXD.png Screen Size: L https://i.sstatic.net/nMwLh.png
Below is the HTML code I am currently working with:
.cram-set-header{
color: #042157;
margin-bottom: 9px;
}
.cram-set{
background-color: #ffffff;
height: 120px;
padding-top: 32px;
border-radius: 5px;
box-shadow: 0px 3px 6px #CBCBCB;
padding-left: 28px;
}
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
<div id="subject-container" class="container-fluid">
<div class="row">
<div class="col-2">
</div>
<div class="col-8">
<div class="row">
<div class="row pt-1">
<h3 id="subject-text">My Sets</h3>
<span class="num-cram-sets pt-1 ml-2">- 8 Cram Sets</span>
</div>
<div class="row ml-auto">
<div class="col-8 pr-0 pb-3">
<button class="btn" id="sign-up-button" data-toggle="modal" data-target="#uploadModal">Upload</button>
</div>
</div>
</div>
<div class="row">
<div class="row col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-4 cram-set mb-3 mr-4">
<h5 class="cram-set-header mb-0">Marketing - Cram Set #1</h5>
<div class="row pl-3">
<p class="mr-1">5.0</p>
<img src="img/star-rating.png" alt="" height="16px">
<p class="ml-2">1,034 Questions</p>
</div>
</div>
<div class="row col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-4 cram-set mb-3">
<h5 class...
I am looking to maintain the margin between boxes when the screen size is minimized. One approach I am considering is creating a class and utilizing media queries to adjust the margin based on screen size, ensuring each box has margin at some point.
For instance, on an XL screen, I do not want the right margin on the box to the far right to allow it to align with the column edge.