I'm attempting to redesign my layout grid using flex. It seems that the flex code I commented out is incorrect, possibly due to an issue with setting the width in my .container class. The grid auto property adjusts the columns automatically within my .even-columns class based on the current width set in .container, but I'm unsure of how to rewrite this using flex.
Do I need to include the correct width property or should I have applied flex to my container instead?
/* CONTAINER CLASS */
.container {
--max-width: 1110px;
--padding: 1rem;
width: min(var(--max-width), 100% - (var(--padding) * 2));
margin-inline: auto;
}
/* EVEN COLUMNS CLASS */
.even-columns {
display: grid;
gap: 1rem;
/* Trying same layout with flexbox
display: flex;
gap: 1rem;*/
}
@media (min-width: 50em) {
.even-columns {
grid-auto-flow: column;
grid-auto-columns: 1fr;
/*Trying same layout with flexbox
display: flex;
flex-direction: column;*/
}
}
<!-- Main -->
<main>
<section>
<div class="container">
<div class="even-columns">
<div>
<h1 class="fs-primary-heading fw-bold">Bring everyone together to build better products.</h1>
<p>Manage makes it simple for software developers to chorolate their projects and share them with other teams and colleagues. </p>
<button class="button">Get Started</button>
</div>
<div>
<img src="images/illustration-intro.svg" alt="">
</div>
</div>
</div>
</section>
<section>
<div class="container">
<div class="even-columns">
<div>
<h2 class="fs-secondary-heading fw-bold">Manage your team</h2>
</div>
<div>
<ul class="numbered-items" role="list">
<li>
<h3 class="fs-600 fw-bold">Advertising</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis laborum at quia odio laudantium qui incidunt, laboriosam facere dolores deleniti quos quod reiciendis deserunt officiis explicabo impedit ducimus, expedita consequatur?</p>
</li>
<li>
<h3 class="fs-600 fw-bold">Version Control</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis laborum at quia odio laudantium qui incidunt, laboriosam facere dolores deleniti quos quod reiciendis deserunt officiis explicabo impedit ducimus, expedita consequatur?</p>
</li>
<li>
<h3 class="fs-600 fw-bold">Database Management</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis laborum at quia odio laudantium qui incidunt, laboriosam facere dolores deleniti quos quod reiciendis deserunt officiis explicabo impedit ducimus, expedita consequatur?</p>
</li>
</ul>
</div>
</div>
</div>
</section>