@adityas24
Posted
Hey Sandesh! great job with this one.
One mistake i saw is that you are using unnecessary divs in your code. Inside each column you have 4 elements. And for each element you are using a div to contain it. You don't really need to do that.
Instead of writing
<div class="col1 box">
<div class="col1Img">
<img src="images/icon-sedans.svg" alt="sedansImg">
</div>
<div class="col1Title"><h2>Sedans</h2></div>
<div class="col1Info">
<p>Choose a sedan for its affordability and excellent fuel economy. Ideal for cruising in the city
or on your next road trip.</p>
</div>
<div class="col1bottom">
<button>Learn More</button>
</div>
</div>
You could have simply written
<div class="col1 box">
<img src="images/icon-sedans.svg" alt="sedansImg">
<h2>Sedans</h2>
<p>Choose a sedan for its affordability and excellent fuel economy. Ideal
for cruising in the city or on your next road trip.</p>
<button>Learn More</button>
</div>
Still the code will work fine as every element inside the flexbox becomes a flex item irrespective of that item is inline or block element.
All the best 🙂👍
Marked as helpful