O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

border

Values:

<'border-width'> || <'border-style'> || <color>

Initial value:

Refer to individual properties

Applies to:

All elements

Inherited:

No

Computed value:

Same as declared value

Description:

A shorthand property that defines the width, color, and style of an element’s border. Note that while none of the values are actually required, omitting a border style will result in no border being applied because the default border style is none.

Examples:

h1 {border: 2px dashed olive;}
a:link {border: blue solid 1px;}
p.warning {border: double 5px red;}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required