CSS: Use and definition of border-spacing attribute

黄舟
Release: 2017-06-30 09:51:42
Original
2940 people have browsed it

In CSSborder-spacingThe function of the attribute is to specify the distance between adjacent cell borders.

border-spacing attribute example

Set border-spacing for table:

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

border-spacing definition and usage

border The -spacing property sets the distance between the borders of adjacent cells (only used in "Border Split" mode).

Note: Some versions of IE browser do not support this attribute.

Description

This property specifies the distance between cell boundaries in the separated border model. Of the two length values ​​specified, the first is the horizontal gap and the second is the vertical gap. This property is ignored unless border-collapse is set to separate. Although this property applies only to tables, it is inherited by all elements in the table.

CSS: Use and definition of border-spacing attribute

Syntax:


border-spacing : length || length
Copy after login

Parameters:

length: A length value consisting of a floating point number and a unit identifier. Cannot be negative. Please refer to the length unit

Description:
Set or retrieve the horizontal and vertical spacing of the row and cell borders when the table border is independent (for example, when the border-collapse property is equal to separate) .
When only one length value is specified, this value will act on the horizontal and vertical spacing. When both length values ​​are specified, the first acts on the horizontal spacing and the second on the vertical spacing.
Currently IE5.5 does not support this attribute.
The corresponding script feature is borderSpacing. Please see other books I have written.

Example:

table { border-collapse: separate; border-spacing: 10px; }
Copy after login

The above is the detailed content of CSS: Use and definition of border-spacing attribute. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template