CSS将父元素下的子元素分组

时间:2018-11-08 13:45:36

标签: css css3 css-selectors

是否可以避免此重复的CSS声明?

仅在一个[nodemon] starting `node app.js` camp Database online removed camps added campground added campground added campground events.js:183 throw er; // Unhandled 'error' event ^ ReferenceError: campground is not defined 下的table thtable td

weather-component

类似...

weather-component table th, 
weather-component table td {
    text-align: center !important;
}

1 个答案:

答案 0 :(得分:0)

在CSS中不可能。但是例如在LESS中,您可以将其写为

.weather-component table {
   th, td {
    text-align: center !important;
  }
}