开发者社区 问答 正文

CSS的属性, 什么时候要加引号, 什么时候不加?

有人总结相应的规律吗?

展开
收起
a123456678 2016-05-27 14:37:02 2019 分享 版权
1 条回答
写回答
取消 提交回答
  • 当属性值是字符串类型的的时候加引号呀,比如

    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

    2019-07-17 19:17:51
    赞同 展开评论
问答分类:
问答标签:
问答地址: