Archived topic
targeting CSS to an image in a container
3 replies · Started by MaryAnn on May 25, 2021
My homepage and section pages feature a big image with a small box of text to its right. Examples:
https://www.flickfilosopher.com/
https://www.flickfilosopher.com/movies-for-the-resistance
These pages look great on desktop, and mobile the text box drops down to below the image, which is perfect. But on tablet, the text box does not drop down. I'm trying to figure out the CSS to target that big image to delete the float, but I can't seem to figure out which element to target. This is what I've tried:
`@media screen and (max-width: 900px) {
.page-template-default .gb-inside-container img
{
float: none;
}
}
@media screen and (max-width: 900px) {
.gb-inside-container img
{
float: none;
}
}
@media screen and (max-width: 900px) {
.page-template-default .gb-container .wp-block-image img
{
float: none;
}
}
But none of these work. Any suggestions?
Thank you!
MaryAnn
Hi MaryAnn,
Try setting the Container width inside the grid wrapper to 100% on tablet as well:
https://docs.generateblocks.com/article/container-overview/#layout-%E2%80%93-grid-item
That's the default for mobile.
Let me know if this helps :)
That did the trick! Thanks.
No problem :)