【发布时间】:2019-12-28 02:05:51
【问题描述】:
我需要子css类继承父css类的属性
.avatar {
min-width: 35px;
max-width: 35px;
height: 35px;
flex: 1 1 35px;
&--home {
margin: 10px;
}
&--post {
margin: 0px 17px 0px 4px;
}
}
我需要应用父类和margin:10px;到具有 avatar--home 类的元素:
<div class="avatar--home"></div>
这只是应用 margin: 10px; 并忽略父属性
【问题讨论】:
-
你不应该使用
property: inherit例如height:inherit吗?