I've got this <ul>
set up with pseudo-element icons before each item. Font Awesome's check mark icon is set as the default for every <li>
, but I want to use specific icons for certain items based on their ID (or class. That doesn't seem to work either). But the specific icon content
declaration doesn't appear to override the default one, even though the selector should be more specific. Here's a quick example:
.cvt-product-tags li:before {
content: '\f00c'; /* Default checkmark icon */
font-family: 'Font Awesome 5 Pro';
}
/* Custom per-li icons */
.cvt-product-tags li#1394:before {
content: '\f21a'!important; /* Custom boat icon */
}
.cvt-product-tags li#1384:before {
content: '\f207'!important; /* Custom bus icon */
}
I set up a more complete pen over here: https://codepen.io/dimedici/pen/PowGbdv.
The confounding thing is that I had something very similar working before some markup changes wherein the content
declaration was being properly overridden. What am I doing wrong? Or, more importantly, how do I get it to work right?