selective use of a pseudoclass

  Kiến thức lập trình

I am using a pseudo-class to change the bullets of all unordered li elements by default to 4 boxes and a white right pointing arrow (▢▢▢▢▷):

      li:before {
        content: "25A225A225A225A225B7";
        padding-right: 0;
      }

I would like to add another pseodo-class to change certain li’s to have the same 4 boxes but a black right pointing arrow (▢▢▢▢▶):

      .known li:before {
        content: "25A225A225A225A225B6";
        padding-right: 0;
      }
<li>general data</li>               <-default for most
<li class="known">marked data</li>  <-those few select cases

but apparently this method (using a class selector) doesn’t work with pseudo-classes.

I am fairly new to pseudo-classes, as i just learned to use them to change all bullets to something else but don’t know how to conditionally apply them (like using a class).

As it stands now, I would have to change content to ” and manually add the boxes and arrow types to each li element’s data.

Thank you for any help given.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT