0

我试图通过使用 LESS 来简化我的 css 创建。到目前为止一切顺利,但是我遇到了一个问题,我的代码如下所示:

#content {

    h1 {
        font-size:20px;
    }

    h2 {
        font-size:10px;
    }
}

现在我也想同时申请font-weight:normal;h1 和 h2,如果没有在每条规则中都有它,我将如何做到这一点?

4

3 回答 3

2
h1, h2
{
    font-weight:normal;
}
于 2011-03-10T19:08:03.433 回答
0

像这样试试

#content {

    h1 {
        font-size:20px;
    }

    h2 {
        font-size:10px;
    }
    h1, h2
    {
        font-weight:normal;
    }
}
于 2011-03-10T19:32:25.490 回答
0
#content {
  font-weight:normal;
  h1 {
    font-size:20px;
  }

  h2 {
    font-size:10px;
  }
}

有时它会有所帮助。实际上并非在所有情况下。

于 2011-07-25T15:18:17.970 回答