Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #887946

    Hi,

    I would like to target all pages except from one with the following CSS code:
    .content {
    padding:0 !important;
    }
    The page that I don’t want to target with it is with the following ID: html_entry_id_44

    Thank you in advance!
    Best,
    Anton

    #888212

    Hey tonydobrevski,

    Please try this:

    .content {
    padding:0 !important;
    }
    
    #html_entry_id_44 .content {
    padding:0 !important;
    }

    Though I’m not sure where you found that ID? It might be better to use the page-id class which you can find in the body tag.

    Best regards,
    Rikard

    #888437
    This reply has been marked as private.
    #888470

    Hi Anton,

    This page does not have a class for unique page id because it looks like a category page.

    Best regards,
    Victoria

    #888682

    Hi Victoria,

    Thank you for the answer! So is there a way to target just this page, so that the padding settings on the page are normal? In other words – using this code excluding the page
    .content {
    padding:0 !important;
    }
    I thought that I could also target all the pages (for ex: .page-id-223, .page-id-342 .content…). However, I am not sure whether this is the most efficient way to do it.

    Thank you in advance!
    Best,
    Anton

    • This reply was modified 6 years, 11 months ago by tonydobrevski.
    #888783

    Hi,

    I’m not sure if it will only target that page, but you can try this CSS:

    .woocommerce-page .content {
    padding:0 !important;
    }

    Best regards,
    Rikard

    #889255

    Hi Rikard,

    Unfortunately, the code didn’t work. I will target the individual page-id’s. However I have the following question: How should I write the code in order to target few pages with the same code. I tried this but it didn’t work:
    .page-id-29, .page-id-13, .page-id-445, .page-id-84, .page-id-78, .page-id-112, .page-id-287, .page-id-10, .page-id-239 .content {
    padding:0 !important;
    }
    After rewriting the code it worked but I would like to make it as short as possible:
    .page-id-445 .content {
    padding:0 !important;
    }
    .page-id-29 .content {
    padding:0 !important;
    }

    Thank you in advance!
    Best,
    Anton

    #889493

    Hi,

    You can do something like this:

    .page-id-239 .content, .page-id-240 .content, .page-id-241 .content {
      Your CSS statements here
    }

    Best regards,
    Rikard

    #889763

    Dear Rikard,

    This worked perfectly. Thank you very much!

    Best,
    Anotn

    #889838

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘How to target all pages except from one with a CSS code?’ is closed to new replies.