我有这样的代码:
tr:first-child th:last-child {
-webkit-border-top-left-radius: 15px;
-moz-border-radius-topleft: 15px;
border-top-left-radius: 15px;
}
tr:first-child th:first-child {
-webkit-border-top-right-radius: 15px;
-moz-border-radius-topright: 15px;
border-top-right-radius: 15px;
}
tr:last-child th:last-child {
-webkit-border-bottom-left-radius: 15px;
-moz-border-radius-bottomleft: 15px;
border-bottom-left-radius: 15px;
}
tr:last-child th:first-child {
-webkit-border-bottom-right-radius: 15px;
-moz-border-radius-bottomright: 15px;
border-bottom-right-radius: 15px;
}我对<td>标签也做了同样的事情。
它应该能使桌子圆圆的。
现在我有麻烦了。
我的网站中有一个表在最后一行隐藏了<td>,用户需要单击<th>行来显示<td>。
CSS假设我的<td>在<tr>的最后一个子部分,所以它是四舍五入的。但问题是它是隐藏的。
<th>位于用户实际看到的<tr>最后一个子程序中,但由于最后一个<td>是隐藏的,而且看起来很糟糕,所以它没有四舍五入。
有什么建议吗?
发布于 2014-02-12 09:07:45
使用最后一个孩子。它从末尾选择rx+n的每个元素。(:nth-last-child(r+n)或:nth-last-child(n) (假设r为0))
tr:nth-last-child(2) th:last-child {}发布于 2014-02-12 09:12:51
您可以在td上使用:最后类型的伪类。类似于td:last-of-type的东西应该能工作。
https://stackoverflow.com/questions/21722946
复制相似问题