I have to make responsive design where in mobile, all elements are aligned in column respectively Title > Images > Button > Details > Informations but in desktop I have to position them like in the image Desktop where Images and Informations need to be in the left of the screen and Title, Button, Details on the right.
Note that Images have dynamic height.
I tried and cant use flex column and flex wrap because Images's height is dynamic like I said.
Here the code I tried with grid-area (Im using TailwindCSS):
<div class="wrapper flex flex-col sm:grid grid-cols-2">
<div class="title h-7 bg-green-400">Title</div>
<div class="images h-96 bg-blue-400">Images</div>
<div class="button h-16 bg-red-400">Button</div>
<div class="details h-32 bg-indigo-400">Shipping details</div>
<div class="informations h-48 bg-amber-400">Informations</div>
</div>
.title {
grid-area: title;
}
.images {
grid-area: images;
}
.button {
grid-area: button;
}
.details {
grid-area: details;
}
.informations {
grid-area: informations;
}
@media (min-width: 500px) {
.wrapper {
grid-template-columns: 1fr 1fr;
grid-template-areas:
"images title"
"images button"
"images details"
"informations details";
}
}
Result :

What I want :
Mobile

Desktop

missing details and claritynot formissing focus(asking multiple questions in one) - tacoshy