【问题标题】:table row hover background color rounded corner effect表格行悬停背景色圆角效果
【发布时间】:2012-01-24 15:33:23
【问题描述】:

表格行具有悬停背景。我需要在背景上做圆角。

table tbody tr#ClickableRow:hover {
  background-color: #fbf6e7;
  -moz-border-radius: 20px;
  -webkit-border-radius: 20px;
  -khtml-border-radius: 20px;
  border-radius: 20px;
  cursor: pointer;
}
<tr id="ClickableRow">
  <td>
    <a href="http://somesite.com">Go Here</a>
    <p>To find about all the interestng animals found in this tourist attractions including zebra, giraffe..... ....
    </p>
  </td>
</tr>

这不起作用。我仍然得到平方的背景。

【问题讨论】:

  • 我这样做。我也投票赞成答案..我想知道为什么它这么低。

标签: jquery css background


【解决方案1】:

尝试在td 而不是tr 上应用边框半径

body {
  margin: 100px;
}
table tbody tr#ClickableRow:hover td {
  background-color: #fbf6e7;
  -moz-border-radius: 20px;
  -webkit-border-radius: 20px;
  -khtml-border-radius: 20px;
  border-radius: 20px;
  cursor: pointer;
}
<table>
  <tr id="ClickableRow">
    <td>
      <a href="http://somesite.com">Go Here</a>
      <p>To find about all the interestng animals found in this tourist attractions including zebra, giraffe..... ....
      </p>
    </td>
  </tr>
</table>

如果您的表格行有多个单元格,您可以这样做:http://jsfiddle.net/petersendidit/RzKbq/1/

【讨论】:

  • 这确实适用于只有一个单元格的行,如果它有两个单元格,它基本上会在单元格边界处产生中断...
  • @AnjuThapa 如果您需要多个单元格,您可以这样做:jsfiddle.net/petersendidit/RzKbq/1
猜你喜欢
  • 2010-10-15
  • 2014-07-24
  • 2011-10-23
  • 1970-01-01
  • 1970-01-01
  • 2021-11-13
  • 2011-12-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多