html定义边界上下为0px,HTML – 边界崩溃有什么区别:崩溃;和边界间距:0;

它们是不同的! (请参阅下面的代码段确认).

The border-collapse CSS property determines whether a table’s borders

are separated or collapsed. In the separated model, adjacent cells

each have their own distinct borders. In the collapsed model, adjacent

table cells share borders.

The border-spacing CSS property specifies the distance between the

borders of adjacent table cells (only for the separated borders

model). This is equivalent to the cellspacing attribute in

presentational HTML, but an optional second value can be used to set

different horizontal and vertical spacing.

The border-spacing value is also used along the outside edge of the

table, where the distance between the table’s border and the cells in

the first/last column or row is the sum of the relevant (horizontal or

vertical) border-spacing and the relevant (top, right, bottom, or

left) padding on the table.

This property applies only when border-collapse is separate.

所以这里是一个SNIPPET,有几个例子

body {

margin: 0;

font-family: Arial;

}

table {

width: 100%;

margin:30px 0

}

td {

border: 1px solid red

}

.collapse {

border-collapse: collapse;

}

.separate {

border-collapse: separate;

}

.no-spacing {

border-spacing: 0

}

.spacing {

border-spacing: 10px

}

Borders will collapse and therefore no space between them
    
    
Borders will try to separate between them but then using border-spacing:0 will join the borders without collpasing (looking like has double borders)
    
    

2 more examples

Border-spacing won't work due to only applies when border-collapse isset to separate
    
    

Borders will separate between them due to having border-spacing:10px and because border-collapse has separate as initial value
    
    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值