Target CSS pseudo selector for only one page of a Wordpress site

Viewed 104

This works great but unfortunately its applied globally. I want to apply the css to a specific page ID (75). If I add a class via the advanced tab in the block editor it breaks, no list icons.

.entry-content ul > li::before {
  content: '\f0da';
  color: #a86500;
  font-family: 'Font Awesome 5 Free';
  padding: 0 10px 0 0;
}

Any ideas?

1 Answers

You don't need to add a class. You should be able to target the page id which is already a class in the body tag. Inspect the page in DevTools and you should see the unique page-id-?? in the classes of the body tag then target like this:

.page-id-75 .entry-content ul > li::before {
content: "\f0da";
color: #a86500;
font-family: "Font Awesome 5 Free";
padding: 0 10px 0 0;     
Related