[Resolved] Mobile Category Padding

Home Forums Support [Resolved] Mobile Category Padding

Home Forums Support Mobile Category Padding

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1467486
    Mark

    Hello, I’m trying to add some padding to category pages on mobile. I saw this on another topic and it didn’t work…


    @media
    (max-width: 768px) {
    .archive .page-header {
    padding: 30px;
    }
    }

    #1467516
    Leo
    Staff
    Customer Support

    Hi there,

    That CSS should be really close.

    Try this:

    @media (max-width: 768px) {
        .archive .page-header {
            padding-left: 30px;
        }
    }
    #1467524
    Mark

    That didn’t work either. I have it on there now.

    #1467532
    Leo
    Staff
    Customer Support

    I’m not seeing the CSS being added.

    Can you clear and disable your caching plugin first?

    #1467541
    Mark

    Done

    #1467549
    Leo
    Staff
    Customer Support

    Does the CSS work if you put it to the top of the Additional CSS field?

    #1467556
    Mark

    I just put it update and it doesn’t appear to be working.

    #1467569
    Mark

    Meant to say up top.

    #1467573
    Leo
    Staff
    Customer Support

    Maybe something is stripping all of your media query CSS. This is the result when I added using the browser inspector:
    https://www.screencast.com/t/8KkGiTh37q

    I’m still seeing WP Rocket activated in the source.

    Can you make sure it’s actually disabled?

    #1467586
    Mark

    My bad, it wasn’t disabled. Autoptimize was. They both are now.

    #1467633
    Leo
    Staff
    Customer Support

    There we go. It was being overwritten by this CSS you’ve also added:

    .separate-containers .page-header {
        background: transparent;
        padding: 20px 0;
    }

    So let’s make it more specific like this:

    @media (max-width: 768px) {
        body.separate-containers.archive .page-header {
            padding-left: 30px;
        }
    }
    #1467638
    Mark

    Just to be clear, remove the top one and replace with bottom one?

    #1467645
    Leo
    Staff
    Customer Support

    Nope you can keep the top one.

    And just add the second one to replace the original code I’ve provided here:
    https://generatepress.com/forums/topic/mobile-category-padding/#post-1467516

    #1467657
    Mark

    Did it and looks great. Thanks!

    One more question while I have you, please. On mobile-only, is there a way to make my added media images in the body of posts stretch the container? I create all of my post images and they will eventually be the same size. Please see the example post on mobile below and you’ll see how the non-features image just misses the left-hand side. Thanks

    #1467670
    Leo
    Staff
    Customer Support

    Any chance you can open a new topic?

    We will get to it 🙂

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.