有可能避免这种重复的CSS声明吗?
不知何故,table th
和table td
只在一个weather-component
下组
weather-component table th,
weather-component table td {
text-align: center !important;
}
就像是...
weather-component (table th, table td) {
text-align: center !important;
}
在CSS中不可能。但是例如在LESS中,你可以把它写成
.weather-component table {
th, td {
text-align: center !important;
}
}