【发布时间】:2018-08-30 14:11:58
【问题描述】:
我有一个div如下:
<tr class="section">
<td>some content here</td>
<td class="info">content 2 here</td>
</tr>
css:
.section{
//style here
}
.info{
//another style here
}
在这种情况下,我不想在 info 中应用 section 样式。
怎么做?
【问题讨论】:
-
HTML 无效。
td只能是tr的子级。 -
它是无效的,但如果我们认为它们跨度......你不能,你只需要恢复样式但不是全部(显示,不透明度等)
-
此外,您无法阻止样式继承 - 您只能覆盖来自父元素的不需要的样式。
-
问及回答here
标签: html css css-selectors