Can you use HTML entities in the CSS “content” property?
This question already has an answer here:
put hex value of your bullet specail character like this
div:before{
content:"2022";
color:#f00;
}
check this fiddle http://jsfiddle.net/sandeep/HPrkU/1/
NOTE: after & before work in IE8
I'm guessing you want the actual •
character displayed, if so simply use the •
character instead of •
.
Example: http://jsfiddle.net/rmjt8/
Edit: I found another thread: How can I include a HTML-encoded "content:" character in CSS?
Perhaps this will validate:
.down:before{
content:"2022 ";
color:#f00;
}
Assuming that you want the user to see the •
you can simply escape that sequence, to give:
.down:before{
content:"• ";
color:#f00;
}
As to why it's not visible on IE7, that's because IE doesn't support generated content or the :before
selector.
Edited to offer that, to see the actual bullet character, you should use:
.down:before{
content:"2022";
color:#f00;
}
JS Fiddle demo.
链接地址: http://www.djcxy.com/p/15532.html上一篇: 如何在CSS元素之后添加一个向下的元素?