这是我的code.i'm悬停第一个tr在表中上一类背景颜色将不会改变前两个td在第一tr.but只有当我将第一个tr悬停必须改变一号两款TD背景颜色会改变,在那里我错过了一些code.it的可能只有在CSStd背景颜色不会改变当我徘徊它
.cls{
background-color:red;
}
[data-class*="weeks"]:hover{
background-color:blue;
}
<table border="1px">
<thead>
<tr>
<th>row1</th><th>row2</th><th>row3</th><th>row4</th><th>row5</th>
</tr>
</thead>
<tbody>
<tr data-class="weeks">
<td class="cls">1</td><td class="cls">2</td><td>3</td><td>4</td><td>5</td>
</tr>
<tr data-class="weeks">
<td>6</td><td>7</td><td>8</td><td>9</td><td>10</td>
</tr>
</tbody>
</table>
为什么您使用* =在选择“周”,而不仅仅是=“周”? –
add this like [data-class * =“weeks”]:hover td {background_color:blue; } –
谢谢code.rider – vijay