Calling all experts in CSS and HTML: Let's say I have 3 columns in a row, each with a different size (refer to the image).
Now, picture this - I want to center the 2nd column right in the middle of my page.
If I simply use justify-content: center
to center the content of the entire row, it would center the whole row as shown below.
But here's the challenge: how do I only center the 2nd column on the page, essentially basing the row's alignment on just one column while keeping them all in a row?
Is there a way to achieve this? Appreciate your insights.
Note: Please refrain from suggesting obvious solutions like "add margin-left to the row." The solution should be adaptable and responsive.
<!-- Code using bootstrap v15 classes -->
<div class="row w-100">
<div class="col-2 purple-bg">
<span>1st column</span>
</div>
<div class="col-4 green-bg">
<span>2nd column</span>
<b class="d-block">I want this column to be centered in the page</b>
</div>
<div class="col-6 red-bg">
<span>3rd column</span>
</div>
</div>