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-width

Values:

[ thin | medium | thick | <length> ]{1,4}

Initial value:

Not defined for shorthand properties

Applies to:

All elements

Inherited:

No

Computed value:

See individual properties

Description:

A shorthand property that defines the width for the overall border of an element or for each side individually. The width will take effect for a given border only if the border’s style is something other than none. If the border style is none, the border width is effectively reset to 0. Negative length values are not permitted.

Examples:

h1 {border-width: 2ex;}
img {border-width: 5px thick thin 1em;}

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