• Resolved jefftaylor

    (@jefftaylor)


    I have several blocks containing 2 to 3 columns that do not extend to the edge on smaller screens (Full screen works fine). This padding or “border” on the left and right sides of my blocks, I would simply like to remove from mobile devices and smaller screens. Any help would be appreciated.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi @jefftaylor,

    I could have suggested custom CSS code solution if you could have used this field in your query.

    Thread Starter jefftaylor

    (@jefftaylor)

    @kharisblank I overlooked this field. Location is on home page: https://nashvillemusicdesign.com/

    Thanks for getting back along with additional information.

    Try this simple CSS code:

    @media only screen and (max-width: 1023px) {
      
        body .site-main.no-sidebar, 
        body .no-sidebar .site-main {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }
        
    }

    Add it to your site’s Additional CSS, that is located under Appearance > Customize menu.

    Thread Starter jefftaylor

    (@jefftaylor)

    @kharisblank That worked well on the home page, but can’t live with no padding on the rest of the site. Do you have any suggestions as to how this change can only be made to the home page where I have the container blocks?

    Thread Starter jefftaylor

    (@jefftaylor)

    @kharisblank This is my current additional CSS code…

    .page-id-1906 {background-color:#333132;}
    .remove-bottom-space {
    margin-bottom: 0;
    }
    .remove-top-space {
    margin-top: 0;
    }
    .content-wrapper {
    margin-top: 0px;
    }

    .single-post .content-wrapper {
    margin-top: 10px;
    }

    @media only screen and (max-width: 670px) {
    .entry-content .wp-block-image{
    margin-left: -15px;
    margin-right: -15px;
    }
    }

    Thread Starter jefftaylor

    (@jefftaylor)

    Shown above, I do have an “@media only screen” CSS code included. It works nicely throughout the site, but wanting no margins on the home page only, not the whole site. Is there a way to just change how the home page responds on mobile by having no margins there, while keeping other pages as they are? Thanks in advance.

    Hi @jefftaylor,

    Try this CSS code:

    @media only screen and (max-width: 1023px) {
      
        body.home .site-main.no-sidebar, 
        body.home .no-sidebar .site-main {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }
        
    }
    Thread Starter jefftaylor

    (@jefftaylor)

    Thanks so much @kharisblank, working great!

    Thread Starter jefftaylor

    (@jefftaylor)

    Thanks Kharis!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘block containing columns does not extend to edge on smaller screens’ is closed to new replies.