有人总结相应的规律吗?
当属性值是字符串类型的的时候加引号呀,比如
css
h1 { font-family: "New Century Schoolbook", serif; background: url("http://www.example.com/pinkish.png"); } h1::before{ content: "\e020"; }
另外, CSS 中的属性值类型有只有下面几种:
- Integers and real numbers
- Lengths, Percentages
- URLs and URIs
- Counters
- Colors
- Strings
- Unsupported Values
参考:
1. http://www.w3.org/TR/2011/REC-CSS2-20110607/fonts.html#font-family-pro...
2. http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#values
这是不需要总结的规律,你看完规范就什么都知道了。