我在使用@extend规则时遇到了一点问题,这是我的代码(请关注h1):
.content-header {
// CSS properties
h1 {
// CSS properties
}
}
.box-header {
// CSS properties
h1 {
@extend .content-header h1; // My selector problem!
// And his own CSS properties
}
}
所以它将是:
.content-header h1, .box-header h1 {
/* Happily sharing the same CSS properties */
}
但似乎@extend
不喜欢那样做,是否有其他方法可以在不给h1
添加类的情况下编写此内容?