如何在悬停时更改表数据单元格背景颜色以及在datacell中更改链接文本

时间:2014-04-07 15:52:28

标签: html css html-table yui

我目前有以下css代码:

.tableLinks a{color:#002a5c; text-decoration: underline;}
.tableLinks:hover a{color:#fff; text-decoration: underline;background-color:#8aa7ca;}
.tableLinks:visited{color:#fff; text-decoration: underline;background-color:#8aa7ca;}

html表格结构:

<td class="tablelinks">
    <div class="yui-dt-class">
         <a href="">the link</a>
    </div>
</td>

我正在尝试使用YUI数据表对表数据单元格中的链接进行样式设置。

我已调用className: 'tablelinks'来尝试设置单元格的悬停状态。

我的目的是在悬停状态下更改表数据单元格背景颜色的全宽和高度,并将链接文本更改为白色。

我尝试使用不同变体的代码,但似乎无法使其正确。任何指导都会很棒!

1 个答案:

答案 0 :(得分:0)

您的CSS选择器不匹配,区分大小写。您的.tableLinks为大写“L”,class="tablelinks"为小写“l”。