skip to Main Content

I’ve read through some similar questions, but can’t quite work it out … I’ve got simple Custom CSS on my WordPress site to increase the space under lists:

ol, ul {
  margin-bottom: 20px;
}

How do I exclude page ID 10875 from having that Custom CSS applied?

2

Answers


  1. body:not(.exclude-page-id-class) ul,body:not(.exclude-page-id-class) ol {
     margin-bottom: 20px;
    }
    
    Login or Signup to reply.
  2. Starting from a body element in which the class is not .page-id-10875 you can specify any nested element with :is(<list of selectors>) or :where(<list of selectors>) pseudoclasses, e.g.

    body:not(.page-id-10875) :where(ul, ol) {
       margin-bottom: 20px;
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search