Name

border

Values:

[ <border-width> || <border-style> || <border-color> ] | inherit

Initial value:

Refer to individual properties.

Applies to:

All elements.

Inherited:

No.

Computed value:

As specified.

Description:

This is 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. Versions of IE/Win previous to IE5.5 do not apply borders to inline elements.

Examples:

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

Supported by:

Firefox, Internet Explorer, Opera, Safari.

Get CSS Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.