<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <style type="text/css"> p:before{ font-family:wingdings; content:"\0022"; color:red; } </style> <title>无标题文档</title> </head> <body> <p>测试伪类添加文字图标的p</p> </body> </html>
有的系统不支持wingdings字体,你换个浏览器试试。 我这用ie11和谷歌浏览器测试正常
p:before{ /*选择字体*/ font-family:wingdings; content:"\0022";--------你少了个分号 color:yellow; }
61,112
社区成员
60,730
社区内容
加载中
试试用AI创作助手写篇文章吧