Site logo

Archived topic

Change padding on posts but not mobile or pages

3 replies · Started by Deirdre on March 24, 2021

Viewing posts 1–4 of 4

Hi there,

I'm having a bit of a brain fart and can't figure out how to change the padding on posts but leave pages and mobile alone. If I change it through Customizer-Layout-Container then the set up I have on my pages goes crazy ( I only want to apply it to posts) and if I try CSS such as

.single-post .entry-content { padding-left: 95px; padding-right: 95px; }

.single-post .entry-header {
padding-top: 20px;
padding-left: 95px;
padding-right: 95px; }
}

then it does what I want but affects mobile with too much padding. How can I change the padding just on desktop posts, not mobile or pages?

Hi Deirdre,

You could give your CSS a media query so it only works on certain screen width, try this instead:

@media (min-width: 769px) {
    .single-post .entry-content { 
        padding-left: 95px; 
        padding-right: 95px; 
    } 
    .single-post .entry-header {
        padding-top: 20px;
        padding-left: 95px;
        padding-right: 95px; 
    }
}

Let me know :)

Perfect, that sorted it, thanks so much!

You are welcome!

This archived topic is closed to new replies.