Site logo

Archived topic

How to remove padding from featured image on mobile only in single posts

3 replies · Started by Puneet on April 27, 2022

Viewing posts 1–4 of 4

Hi
Currently, this is how the single post featured image looks on a mobile device:-

https://snipboard.io/3fYNBG.jpg

How do I remove the padding from its sides so that it applies only on mobile and not on desktop? It's not happening through the customizer. If I tick the padding off, then it goes off for all devices. Want to achieve something like this on mobile:-

https://snipboard.io/TBmzc9.jpg

Thanks and regards,
Puneet

Hi there,

try adding this CSS:

@media(max-width: 768px) {
    .single-post .featured-image {
        margin-left: -30px;
        margin-right: -30px;
    }
}

the negative margin values should equal the same px value as you have for your mobile container padding.

Hi David,
Works perfectly, thanks.

Regards,
Puneet

Glad to hear that

This archived topic is closed to new replies.