Home>Support>Reduce margins on articles (mobile only)

Reduce margins on articles (mobile only)

Hello, I would like to reduce margins of articles text, but only on mobile devices, so that the article on mobile almost takes full width of the device. Specifically, a margin-left: -20px; margin-right: -20px; would do, but how do i add that code to mobile devices only?

URL: https://degeneratione.it

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    Hi n3d1117

    Shooting from the hip here but most likely something like this:

    @media (max-width: 680px) {
    
    .single #main {
    padding-right: 5px;
    padding-left: 5px;
    
    }
    

    Add the above to Appearance > Custom CSS and edit as required.

  2. 9 years, 8 months ago n3d1117

    Thank you! It worked straight away. How do I extend that to blog page too?

  3. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    Super, glad that helped.

    Including blog and archive should look something like this:

    @media (max-width: 680px) {
    
    .blog #main, .archive #main, .single #main {
    padding-right: 5px;
    padding-left: 5px;
    
    }
    
  4. 9 years, 8 months ago n3d1117

    Thanks! That worked too. Last question: how to extend that to every single page in the site? (While keeping meta slider in home page full width)

  5. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    For that you can just say:

    @media (max-width: 680px) {
    
    #main {
    padding-right: 5px;
    padding-left: 5px;
    
    }
    

    Meta Slider comes before #main.

  6. 9 years, 8 months ago n3d1117

    Much love for you Andrew <3

  7. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    Super, glad that helped :)

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More