I recently got help on an issue I got and the final code is in the code section. Now I have just recognized that for smartphone view it does not look the way I want it. The current format is as follows:
Image | Text
Text | Image
Image | Text
Text | Image
For mobile view it should be:
Image
Text
Image
Text
Image
Text
Image
Text
The format for the second and fourth row have to be changed for the mobile view, in order to have the order image - text - image - text etc. For mobile view I have this section: @media only screen and (max-width: 768px){}. Also, does it make sense to have a separate class for each row? Can you please help?
.h1 {
display: flex;
align-items: center;
justify-content: center;
font-size: 50px;
padding-bottom: 50px;
}
.text {
font-size: 24px;
flex-direction: column;
}
.desc {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.image,
.text {
display: flex;
flex: 1 1 50%;
align-items: center;
justify-content: center;
padding: 10px 10px 20px 10px;
box-sizing: border-box;
flex-direction: column;
border: 2px solid;
}
.image img {
max-width: 80%;
}
.left {
justify-content: flex-start;
}
.right {
justify-content: flex-end;
}
<div class="h1">Headline</div>
<div class="desc">
<div class="image left">
<img src="https://homepages.cae.wisc.edu/~ece533/images/mountain.png">
</div>
<div class="text">
<b>Text</b>
<p>Text</p>
</div>
<div class="text">
<b>Text</b>
<p>Text</p>
</div>
<div class="image right">
<img src="https://homepages.cae.wisc.edu/~ece533/images/mountain.png">
</div>
<div class="image left">
<img src="https://homepages.cae.wisc.edu/~ece533/images/mountain.png">
</div>
<div class="text">
<b>Text</b>
<p>Text</p>
</div>
<div class="text">
<b>Text</b>
<p>Text</p>
</div>
<div class="image right">
<img src="https://homepages.cae.wisc.edu/~ece533/images/mountain.png">
</div>
</div>