• Resolved blanch69

    (@blanch69)


    I am trying to reduce to zero all the margins, etc. for just one particular page (Gallery). This is the code I have but it’s not working. Appreciate your help

    .gallery .site-content.content-wrapper.full-width.without-featured-image {
    margin-left: 0px;
    margin-right: 0px;
    padding-left: 0px;
    padding-right: 0px;
    border-left-width: 0px;
    }

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @blanch69 – could you please provide a link to the page on your site so we can take a look? It’s going to be much easier to help you if we can see what we’re doing directly. Thank you!

    Thread Starter blanch69

    (@blanch69)

    I figured it out:

    Syntax:
    #page-id-xx .nameoffirstclass, .nameofsecondclass {
    Html attribute1: xxpx !important;
    Html attribute2: xxpx !important;
    }

    Actual code:
    #page-id-31 .site-content.content, .content-wrapper.full-width.without-featured-image {
    margin-left: 0px !important;
    margin-right: 0px !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
    }

    Thanks for posting your CSS. Couple of notes: we normally try to avoid using !important wherever we can, because it makes it impossible to override the element elsewhere. If you require !important, it often means you likely need to choose a more specific element. Also, a unit is not required when you use the number 0.

    If you need further help, please provide a link to your site so we can assist you better. Thanks!

    Thread Starter blanch69

    (@blanch69)

    This is the site if you would like to suggest better code:

    https://test.inventia.us/

    Thanks for the feedback

    A.

    Thanks for the link. Give this a try:

    .page-id-31 .content-wrapper.full-width.without-featured-image, .page-id-592 .content-wrapper.full-width.without-featured-image {
      margin-left: 0;
      margin-right: 0;
      padding-left: 0;
      padding-right: 0;
    }

    It removes all the importants and applies to the two specific pages you’ve identified. The dot identifies the page class.

    Thread Starter blanch69

    (@blanch69)

    Much more elegant, thanks.

    My pleasure.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adjust margins, padding, etc. for single page’ is closed to new replies.