Kanye
Kanye
KPCKevin Powell - Community
Created by Boeroe on 11/11/2023 in #front-end
Get the image under the text
There's multiple ways to go about it, but i just used media querys
.img {
max-width: 100%;
height: auto;
}

.img img {
width: 100%;
height: auto;
object-fit: cover;
object-position: center;
}

/* Media Query for Mobile View */
@media (max-width: 768px) {
.sections {
flex-direction: column; /* Stack elements in a column on smaller screens */
}

.img {
max-width: 100%; /* Adjust this to control the maximum width */
height: auto;
}
}
.img {
max-width: 100%;
height: auto;
}

.img img {
width: 100%;
height: auto;
object-fit: cover;
object-position: center;
}

/* Media Query for Mobile View */
@media (max-width: 768px) {
.sections {
flex-direction: column; /* Stack elements in a column on smaller screens */
}

.img {
max-width: 100%; /* Adjust this to control the maximum width */
height: auto;
}
}
2 replies