仅在悬停时突出显示单元格

时间:2014-04-04 09:07:22

标签: css css3 twitter-bootstrap

我有下表:

<table class="table table66 table-bordered">
<thead>
    <tr>
        <th>#</th>
        <th>name</th>
        <th>age</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>1</td>
        <td>Alan</td>
        <td>11</td>
    </tr>
</tbody>

我想要突出显示我悬停的单元格,而不是整行。我试过这个没有成功:

td.table66:hover {
            background-color: #C0C0C0;
}

2 个答案:

答案 0 :(得分:4)

尝试

.table66 td:hover {
    background-color: #C0C0C0;
}

您在示例中所做的是尝试选择td同时拥有该课程table66的{​​{1}},当您的table拥有该课程时。

答案 1 :(得分:0)

试试这个。

.table66 td:hover {
    background-color: #C0C0C0;
}
相关问题