-
AuthorPosts
-
December 12, 2017 at 2:56 pm #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_44Thank you in advance!
Best,
AntonDecember 13, 2017 at 5:51 am #888212Hey 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,
RikardDecember 13, 2017 at 4:46 pm #888437This reply has been marked as private.December 13, 2017 at 5:25 pm #888470Hi Anton,
This page does not have a class for unique page id because it looks like a category page.
Best regards,
VictoriaDecember 14, 2017 at 1:29 am #888682Hi 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.
December 14, 2017 at 8:35 am #888783Hi,
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,
RikardDecember 15, 2017 at 12:06 pm #889255Hi 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,
AntonDecember 16, 2017 at 9:33 am #889493Hi,
You can do something like this:
.page-id-239 .content, .page-id-240 .content, .page-id-241 .content { Your CSS statements here }
Best regards,
RikardDecember 17, 2017 at 12:02 pm #889763Dear Rikard,
This worked perfectly. Thank you very much!
Best,
AnotnDecember 17, 2017 at 10:51 pm #889838 -
AuthorPosts
- The topic ‘How to target all pages except from one with a CSS code?’ is closed to new replies.