I am trying to create a 3-column preview card. I cannot get the 3 column to be horizontally aligned. This is a project from Front-end Mentor.
I am new to this I don't know if I wrote this correctly.
This is what it looks like:
In CSS, I have tried to comment out certain parts to see if it will fix the issue but when I fix one, I mess up another. I just want the columns to be aligned horizontally right now.
* {
--bright-orange: hsl(31, 77%, 52%);
--dark-cyan: hsl(184, 100%, 22%);
--very-dark-cyan: hsl(179, 100%, 13%);
--transparent-white: hsla(0, 0%, 100%, 0.75);
--very-light-gray: hsl(0, 0%, 95%);
}
body {
font-size: 15px;
font-weight: 400;
background-color: var(--very-light-gray);
font-family: 'Lexend Deca', sans serif;
min-height: 100vh;
display: flex;
align-items: center;
font-size: 15px;
}
h1 {
text-transform: uppercase;
font-weight: 400;
font-family: 'Big Shoulders Display', cursive;
color: var(--very-light-gray);
}
#car-container {
max-width: 960px;
width: 550px;
height: 40px;
margin: 0 auto;
display: grid;
padding: 20px;
}
.wrapper {
display: grid;
min-height: 12vh;
border-radius: 12px;
margin: 2rem;
display: inline-block;
}
.cars {
float: left;
width: 33.33%;
height: 340px;
color: var(--transparent-white);
padding: 40px;
}
@media (max-width: 992px) {
#car-options {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
max-width: 900;
}
}
#sedans {
background-color: var(--bright-orange);
border-radius: 8px 0 0 4px;
}
#suvs {
background-color: var(--dark-cyan);
}
#luxury {
background-color: var(--very-dark-cyan);
border-radius: 0 8px 8px 0;
}
#sedan-btn {
background-color: var(--very-light-gray);
color: var(--bright-orange);
border-radius: 30px;
border: none;
padding: 9px 10px 9px 10px;
}
button {
cursor: pointer;
}
#suv-btn {
background-color: var(--very-light-gray);
color: var(--dark-cyan);
border-radius: 30px;
border: none;
padding: 9px 10px 9px 10px;
}
#luxury-btn {
background-color: var(--very-light-gray);
color: var(--very-dark-cyan);
border-radius: 30px;
border: none;
padding: 9px 10px 9px 10px;
}
<section class="car-container">
<div class="wrapper">
<div class="cars" id="sedans">
<img src="images/icon-sedans.svg" alt="sedan icon">
<h1>Sedans</h1>
<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 id="sedan-btn">Learn More</button>
</div>
<div class="cars" id="suvs">
<img src="images/icon-suvs.svg" alt="SUV icon">
<h1>SUVs</h1>
<p>Take an SUV for its spacious interior, power, and versatility. Perfect for your next family vacation and off-road adventures.
<button id="suv-btn">Learn more</button></p>
</div>
<div class="cars" id="luxury">
<img src="images/icon-luxury.svg" alt="luxury car icon">
<h1>Luxury</h1>
<p>Cruise in the best car brands without the bloated prices. Enjoy the enhanced comfort of a luxury rental and arrive in style.
<button id="luxury-btn">Learn more</button></p>
</div>
</div>
</section>
<footer class="attribution">
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. Coded by <a href="http://www.iamkianna.com" target="_blank">Kianna Hendricks</a>.
</footer>