When the viewport width reaches 750px, I want to use flexbox to change the layout of my information from one column to four rows:
* {
box-sizing: border-box;
}
h1,
h2,
h3,
h4,
h5,
h6 {
text-align: center;
}
section {
border: inset #333 thin;
padding: 1em;
/
}
.animals {
display: flex;
flex-direction: column;
background-color: DodgerBlue;
}
.minerals {
display: flex;
flex-direction: column;
background-color: rgb(255, 30, 218);
}
.vegetables {
display: flex;
flex-direction: column;
background-color: rgb(233, 255, 30);
}
@media screen (min-width: 750px) {
.body {
display: flex;
flex-direction: row;
}
}
<div class="animals">
<header>
<h2>Animals</h2>
<h3>DNC</h3>
</header>
<main>
<section>
<h4>Animal One</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Virtutis, magnitudinis animi, sit amet, consectetur adipiscing elit.</p>
</section>
<section>
<h4>Animal Two</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Virtutis, magnitudinis</p>
</section>
<section>
<h4>Animal Three</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Virtutis, magnitudinis animi, fortitudinis fomentis dolor mitigari solet. Omnes enim iucundum motum.</p>
</section>
<section>
<h4>Animal Four</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
</section>
</main>
</div>