Todo :
当前表HTML :
<table id="ember11999" class="ember-view content-table focus-group ovalview object-table container-view highlighted">
<tbody id="ember12032" class="ember-view body-view container-view">
<tr id="ember12347" class="ember-view content-row body-row-view container-view" tabindex="0" aria-label="">
<td>...</td>
<td>...</td>
</tr>
</tbody>
</table>试用CSS :
table.content-table.ovalview.highlighted tr.content-row {
background: #FFFF99 none 0 0 repeat;
}当我尝试上述代码时,背景色会影响整个表。但我只需要在选择表行上。
发布于 2018-08-28 11:34:25
基于你的问题,这就是你想要达到的目标吗?
table.content-table.ovalview.highlighted tr.content-row.inspected:focus {
background: #FFFF99 none 0 0 repeat;
}<table id="ember11999" class="ember-view content-table focus-group ovalview object-table container-view highlighted">
<tbody id="ember12032" class="ember-view body-view container-view">
<tr id="ember12347" class="ember-view content-row body-row-view container-view inspected" tabindex="0" aria-label="">
<td>Click</td>
<td>me</td>
</tr>
<tr id="ember12347" class="ember-view content-row body-row-view container-view inspected" tabindex="0" aria-label="">
<td>Click</td>
<td>me</td>
</tr>
</tbody>
</table>
希望我帮了你。
发布于 2018-08-28 11:20:58
尝尝这个
table.content-table.ovalview.highlighted tr.content-row.inspected {
background: #FFFF99;
}或
table.content-table.ovalview.highlighted tr.content-row.inspected {
background-color: #FFFF99;
}发布于 2018-08-28 11:26:48
首先,您的tr没有inspected类,它是css选择器的一部分。
如果在添加类之后它仍然不能工作,那么很多时候,tds有一个背景(从一些css中),所以它“隐藏”了tr的背景。也许这也是你的案子。将您的风格更改为在td上。
table.content-table.ovalview.highlighted tr.content-row.inspected td {
background: #FFFF99 none 0 0 repeat;
}https://stackoverflow.com/questions/52056581
复制相似问题