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

Values:

[ <length> | <percentage> | <number> | auto ]{1,4}

Initial value:

1

Applies to:

All elements except table elements where border-collapse is collapse

Inherited:

No

Percentages:

Refer to the size of the border image area

Computed value:

Same as declared value (but see description)

Description:

Defines an image width for each of the four sides of an image border. Border image slices that have a different width than the border image width value are scaled to match it, which may impact how they are repeated. For example, if the right edge of an image border is 10 pixels wide, but border-image-width: 3px; has been declared, the border images along the right side are scaled to be three pixels wide.

Note that border-image-width is different from border-width: a border image’s width can be different than the width of the border area. In cases where the image is wider or taller than the border area, it will be clipped by default (but border-image-outset may prevent this). If it is narrower or shorter than the border area, it will not be scaled up.

Examples:

aside {border-image-width: 8 3 13;}
div#pow{border-image-width: 25px 35;}

Note:

As of early 2011, browsers did not support border-image-width. It is included because border-image (which encompasses border-image-width) was supported and browsers were expected to add border-image-width support by the end of 2011.

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