By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

CSS Border Property

Shows how to use the border shorthand property to set all four borders of an element at the same time.

Edited: 2015-12-07 13:10

The border property, is the short-hand way of setting the border.

Possible Thickness Values

  • thin
  • medium
  • thick

Read Units of Measurement to understand the values

Possible Style Values

  • none [no border]
  • hidden [same as none?]
  • dotted [dotted border]
  • dashed [dashed border]
  • solid [solid border]
  • double [Two borders, width of each is same as border-width value]
  • groove [3D-like effect, depends on border-color value]
  • ridge [3D-like effect, depends on border-color value]
  • inset [3D inset border. effect, depends on border-color value]
  • outset [3D outset border. effect, depends on border-color value]

Possible Color Values

Read the Colors entry in the referance to understand its many possible values.

div {
  border: 1px dotted black;
}

Inherited? NO!