html 怎么取消dl 边框,html – 由于Chrome中的colspan,无法删除边框

这是一个

known Chrome issue,而且非常烦人.

April 1 2014

It’s a known (old) issue in our table code. Collapsing borders are determined based on adjacent cells and our code doesn’t deal correctly with spanning cells (we only consider the cell adjoining the first row / column in a row / column span). On top of that, our border granularity is determined by the cell’s span.

To fix this bug, we would need to overhaul our collapsing border code, which is a big undertaking.

(归功于Paolo Forgia的备用answer,这是第一个注意到Chromium线程的.)

分离边界是一种选择,但我知道我个人讨厌使用分离的细胞边界.你遇到的问题是,每个其他单元格只需要在一个站点上有一个边框,这就变得非常头疼,更不用说CSS标记的卷积了.

使您能够保持可折叠边框的解决方法类似于下面的方法.它在单元格中创建一个伪元素,用白色覆盖红色边框.

body {

background: white;

}

table {

border-collapse: collapse;

}

td {

border: 1px solid red;

}

td.nb {

border: 0 !important;

}

/* New class for cells affected by this issue */

td.nbtb {

position: relative;

border: 0 !important;

}

/* Pseudo-element to cover up the borders */

td.nbtb::after {

position: absolute;

top: 0px;

left: 0px;

display: block;

content: '';

width: 100%;

height: calc(100% + 1px);

border: 1px solid white;

box-sizing: border-box;

}

Foo
HelloWorldBar
Foo
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值