编辑器中显示font property font-family has not generic default

来源:互联网 发布:淘宝卖家设置花呗支付 编辑:程序博客网 时间:2024/06/13 04:00

解决编辑器中显示font property font-family has not generic default


原因:编辑器检查CSS代码时,在font-size属性显示font property font-family has not generic default,编辑器是根据W3C标准来提示的,是因为没有定义generic -family,即:字体的所属风格。

例如:serif、sans-serif、cursive

解决方法:

加上generic -family,中文用serif或sans-serif

body{font-family:"宋体",serif;}


注意:设置字体一般用英文,但是最好使用UNICODE编码。


转载:http://blog.csdn.net/gxdvip/article/details/51830279