Home·CSS properties

border-spacing

Tables

The gap between cells; only meaningful when borders are not collapsed.

How to write itborder-spacing: 0;
Common values0, 2px
InheritedYes — children receive it
CategoryTables

How to read this

  • An inherited property only needs writing once on the parent — every child picks it up. Most text properties work this way.
  • A shorthand resets whatever you leave out. Writing background: red alone also wipes a background image you set earlier.
  • When rules collide, the more specific selector wins; only when specificity ties does source order decide.
  • Animate transform and opacity for smoothness. Changing width or top forces the layout to be recalculated.

Frequently asked questions

Q. What is the CSS border-spacing property?

The gap between cells; only meaningful when borders are not collapsed.

Q. How do you write border-spacing?

As border-spacing: 0; Common values include 0, 2px.

Q. Is border-spacing inherited?

Yes. Set it once on the parent and every child uses the same value without repeating it.

Q. What group does border-spacing belong to?

The tables group.

Properties in the same group

Reference docs