Extensible HyperText Markup Language

border-width

Definition

The border-width property specifies the width of the element's four borders. The border is the space between the element's padding and the element's margin, as represented by the yellow highlighted area in the illustration below.

Illustration of the CSS box model. The area between padding and margin is highlighted in yellow.

Example

  1. h1 {border-width: 1px 2px 1px 1px}
  2. h2 {border-width: thick thin}

Characteristics

Possible values

  • One, two, three or four of the following values:

    thin
    A fine border.
    medium
    A medium thickness border.
    thick
    A thick border.
    length
    The border's thickness has an explicit value. Explicit border widths cannot be negative.

    If there is only one value, it applies to all four borders. If there are two values, the top and bottom borders are set to the first value, while the left and right borders are set to the second. If there are three values, the top border is set to the first value, the left and right borders to the second value, and the bottom border to the third value. If there are four values, they apply to the top, right, bottom, and left borders, respectively.

  • inherit
    Use the same computed value as the parent element for this property.

Default value

medium

Applies to

All elements

Inherited

No

See also

XStandard XHTML WYSIWYG editor
A standards-compliant WYSIWYG editor component for content management applications. The editor generates valid XHTML and uses CSS for formatting. Free version is available.

Check out XStandard