首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >CSS边框-最后一个孩子的半径

CSS边框-最后一个孩子的半径
EN

Stack Overflow用户
提问于 2014-02-12 08:55:57
回答 2查看 638关注 0票数 2

我有这样的代码:

代码语言:javascript
复制
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>是隐藏的,而且看起来很糟糕,所以它没有四舍五入。

有什么建议吗?

EN

Stack Overflow用户

回答已采纳

发布于 2014-02-12 09:07:45

使用最后一个孩子。它从末尾选择rx+n的每个元素。(:nth-last-child(r+n):nth-last-child(n) (假设r为0))

代码语言:javascript
复制
tr:nth-last-child(2) th:last-child {}
票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21722946

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档