我的css文件的一部分:
.icon-activity_needs_assessment:before {
content: "\e600";
}
这是我在javascript中访问CSS规则时在控制台中看到的内容:
CSSStyleRule {
cssText: ".icon-activity_needs_assessment::before { content: ""; }"
parentRule: null
parentStyleSheet: CSSStyleSheet {ownerRule: null, cssRules: CSSRuleList, rules: CSSRuleList, type: "text/css", href: "http://localhost:3000/humanitarian-icons.css", …}
selectorText: ".icon-activity_needs_assessment::before"
style: CSSStyleDeclaration {0: "content", alignContent: "", alignItems: "", alignSelf: "", alignmentBaseline: "", all: "", …}
styleMap: StylePropertyMap {size: 1}
type: 1
__proto__: CSSStyleRule
}
为什么我看到content: "";
而不是content: "\e600";
?我有很多这样的CSS类,并且每一个我在JS中看到{ content: ""; }
。这是为什么?谢谢。