【发布时间】:2021-02-22 03:30:53
【问题描述】:
我有两个从 icn- 和 in-betwen icn- 开始的 senario 类。两者具有相同的属性。我们可以添加一个选择器或 regex,这两种情况都适用吗?
.f20 [class^="icn-"]:before,.f20 [class*=" icn-"]:before {
font-family: 'icons' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale
}
【问题讨论】:
-
icn不是一个类的任何原因?您可以根据多个类别进行选择。编辑:例如,如果您将icn-whatever分为两个类icn和whatever,那么您有.icn-whatever的地方可以放入.icn.whatever(注意没有空格)。当然,如果需要,您可以单独选择.icn。