我试图通过使用 LESS 来简化我的 css 创建。到目前为止一切顺利,但是我遇到了一个问题,我的代码如下所示:
#content {
h1 {
font-size:20px;
}
h2 {
font-size:10px;
}
}
现在我也想同时申请font-weight:normal;
h1 和 h2,如果没有在每条规则中都有它,我将如何做到这一点?
我试图通过使用 LESS 来简化我的 css 创建。到目前为止一切顺利,但是我遇到了一个问题,我的代码如下所示:
#content {
h1 {
font-size:20px;
}
h2 {
font-size:10px;
}
}
现在我也想同时申请font-weight:normal;
h1 和 h2,如果没有在每条规则中都有它,我将如何做到这一点?
h1, h2
{
font-weight:normal;
}
像这样试试
#content {
h1 {
font-size:20px;
}
h2 {
font-size:10px;
}
h1, h2
{
font-weight:normal;
}
}
#content {
font-weight:normal;
h1 {
font-size:20px;
}
h2 {
font-size:10px;
}
}
有时它会有所帮助。实际上并非在所有情况下。