The best CSS border-spacing property Tutorial In 2024, In this tutorial you can learn Examples,Attribute definitions and instructions,Browser Support,Property Values,related articles,

CSS border-spacing property

Examples

Set the table padding:

table
{
border-collapse:separate;
border-spacing:10px 50px;
}


Attribute definitions and instructions

border-spacing property to set the distance between the borders of adjacent cells (only for the "separated borders" model).

Defaults: not specified
inherit: no
version: CSS2
JavaScript syntax: object object.style.borderSpacing = "15px"


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support border-spacing property.

Note that IE8 need to define!DOCTYPE. Only support border-spacing property.


Property Values

描述
length length 规定相邻单元的边框之间的距离。使用 px、cm 等单位。不允许使用负值。
  • 如果定义一个 length 参数,那么定义的是水平和垂直间距。
  • 如果定义两个 length 参数,那么第一个设置水平间距,而第二个设置垂直间距。
inherit 指定应该从父元素继承border - spacing属性的值


related articles

CSS tutorial: CSS the Table

CSS border-spacing property
10/30