I have a basic grid layout:
.container{
display:grid;
gap:20px;
grid-template-columns: repeat (12, 1fr)
}
.container >*{
grid-column-start: span 12
}
@media(min-width:768px){
.item{
grid-column-start:span 6
}
}
<div class="container">
<div class="item"><img src="..."></div>
<div class="item"><p>Text</p></div>
<div class="item"><img src="..."></div>
<div class="item"><p>Text</p></div>
<div class="item"><img src="..."></div>
<div class="item"><p>Text</p></div>
</div>
How can I have the image in the second row on the right on screen sizes above 768px, and the text on the left?
2
Answers
To have the image in the second row on the right on screen sizes above 768px and the text on the left, you can update your code.
Here’s one way you could do it.