Extensible HyperText Markup Language

XHTML.com recommends: PSD to HTML Slicing Service

border

Definition

The border property is a shorthand method for setting the save values for border-width, border-style and border-color for all four borders. Border is the space between the element's padding and the element's margin, and is 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. p {border: 1px dashed blue}

This is equivalent to:

  1. p {
  2. border-top: 1px dashed blue;
  3. border-bottom: 1px dashed blue;
  4. border-left: 1px dashed blue;
  5. border-right: 1px dashed blue;
  6. }

Characteristics

Possible values

Default value

See individual properties

Applies to

Inherited

No

See also