Archived topic
Removing images from mobile with CSS
1 reply · Started by Danielle on October 7, 2021
Hi,
I have a landing page to sell some ebooks with one picture at the top (cover) and one at the bottom (testimonial). I wanted to make specific ones for mobile and desktop (4 in total) and then only show the right ones for those devices. This is the CSS I have come up with:
@media (min-width: 1025px) {
.bundle-cover-m {
display: none;
}
}
@media (max-width: 768px) {
.bundle-cover-d {
display: none;
}
}
@media (min-width: 1025px) {
.testimonial-m {
display: none;
}
}
@media (max-width: 768px) {
.testimonial-d {
display: none;
}
}
The CSS for desktop works and only the desktop images are shown. However, the mobile CSS does nothing although I have tried multiple width settings.
Thanks,
Danielle
Hi there,
Are you adding those CSS Classes to your HTML/Blocks ?
If so GeneratePress has built in hide-on-* classes that you can use - see here:
https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classes