Skip to content Skip to sidebar Skip to footer

How To Use Character Code With ::before Pseudo Element

I have html with and want add black right-pointing pointer to span::before but it`s not working. If I simply put ► to html I would see pointe

Solution 1:

► is the unicode for a right pointing arrow

25B6 or 25BA is the hex for a right pointing arrow

In CSS you need to escape the hex when using it, see working example

e.g.

span::before {
  content: '\25B6';
}

#span-2::before {
  content: '\25BA';
}
<metacharset="UTF-8"><span> Right Pointing Arrow</span><br><br><spanid="span-2"> Another right pointing arrow</span><p>&#9658; Unicode Right pointing arrow in HTML</p>

Post a Comment for "How To Use Character Code With ::before Pseudo Element"