I'm trying to add content to something before an item using the CSS :before + content: fields. I want to insert a checkmark (☑), BUT if I use that in the content option, it prints as the literal. How can I tell CSS to make that a checkmark, not the literal string ☑?
相关问题
- Adding a timeout to a render function in ReactJS
-
Why does the box-shadow property not apply to a
- Add animation to jQuery function Interval
- jQuery hover to slide?
- Issue with star rating css
You need to use Unicode values inside the
content
property. (The list of miscellaneous symbols may also be useful.)A heavy checkmark is listed as
U+2713
so you would putcontent: "\2713";
Use the checkbox character literally in your CSS rule instead of the encoding -
See: http://jsfiddle.net/e3Wt2/
Try this: