繁体   English   中英

一旦仅使用css悬停一行,如何使行的最后td突出显示?

[英]How to make last td of the row to highlight once a row is hovered just using css?

我想突出显示该行悬停时的最后一个单元格。 是否有可能仅用CSS做到这一点。 这是工作链接。

http://jsbin.com/isukemih/2/edit

我尝试了以下方法

tr:hover {
  background-color: #f00;
}

tr:last-child:hover {
  background-color: #f00;
}

使用此设置将悬停的行的最后一个单元格的背景颜色设为红色:

tr:hover td:last-child {
  background-color: #f00;
}

示范

尝试这个

tr:hover td:last-child {
  background-color: #f00;
}

你有很多不错的选择

tr:hover td:last-child {
  background-color: red;
}

要么

tr:hover td:last-of-type {
  background-color: red;
}

要么

tr:hover td:nth-last-child(1){
    background:red;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM