表格行和边框

发布于 2024-10-03 02:36:04 字数 640 浏览 3 评论 0原文

当我将 psd 转换为 html/css 时,我陷入了困境

页面是这样的: http:// /valogiannis.com/freelancer/neurosport/editdetails.html

在标题“编辑帐户详细信息”下方,我有一个表格来显示用户数据。

我对行有以下规则

#editAccountDetails tr {
    border-bottom:#cdd3e0 solid 1px;
    border-top:#fff solid 1px;
    line-height:3;
}

正如您在页面中看到的,蓝色底部边框与白色顶部边框重叠。我在所有浏览器中得到相同的结果,所以我认为这是正常行为,这是我无法理解的。

我想要实现的是边框底部正好位于白色边框顶部上方。有什么建议吗?

PS 如果你知道的话,还有其他对我有帮助的事情。如何使最新行的 border-bottom 不出现,第一行的 border-top 不出现?我认为它类似于 tr + tr {... } 但我不太记得了。

I have stuck in a point when I convert a psd to html/css

The page is this : http://valogiannis.com/freelancer/neurosport/editdetails.html

Below the title "Edit Account Details" I have a table to show the user data.

I have I have the following rule for the rows

#editAccountDetails tr {
    border-bottom:#cdd3e0 solid 1px;
    border-top:#fff solid 1px;
    line-height:3;
}

As you can see in the page the blue bottom-border overlap the white border-top. I get the same result in all browser so I suppose is normal behavior and it's something that I can't understand.

What I want to achieve is the border-bottom to be exactly above the white border-top. Any suggestion?

P.S Something else that would help me if you know. How can I make the border-bottom don't appear for the latest row and border-top for the first row? I think it's something like tr + tr {... } but I don't remember exactly.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦醒灬来后我 2024-10-10 02:36:04

你看不到边框的原因是因为这是在你的reset.css中,

table {
  border-collapse: collapse
}

将其添加到你的css中

#editAccountDetails table {
  border-collapse: seperate
}

你还需要删除从tr到td的边框

#editAccountDetails td {
border-bottom:1px solid #CDD3E0;
border-top:1px solid #FFFFFF;
}

第一行的选择器是

   #editAccountDetails tr:first-child {color:blue} 

:最后一行是:(最后一行在 ie 中不起作用)

   #editAccountDetails tr:last-child {color:blue} 

The reason you cant see your borders is because this is in your reset.css

table {
  border-collapse: collapse
}

add in this to your css

#editAccountDetails table {
  border-collapse: seperate
}

You will also need to remove the borders from the tr to the td

#editAccountDetails td {
border-bottom:1px solid #CDD3E0;
border-top:1px solid #FFFFFF;
}

And the selector for the first row is:

   #editAccountDetails tr:first-child {color:blue} 

And the selector for the last row is: (last row doesnt work in ie)

   #editAccountDetails tr:last-child {color:blue} 
转角预定愛 2024-10-10 02:36:04
table {
  border-collapse: collapse
}

试试这个

table {
  border-collapse: collapse
}

try this

挽心 2024-10-10 02:36:04

只需将边界放在 TD 上而不是 TR 上,一切都会好起来:-)

#editAccountDetails tr td {
    border-bottom:#cdd3e0 solid 1px;
    border-top:#fff solid 1px;
    line-height:3;
}

Simply put borders on the TD instead of TR and all will be well :-)

#editAccountDetails tr td {
    border-bottom:#cdd3e0 solid 1px;
    border-top:#fff solid 1px;
    line-height:3;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文