CSS Reference ยท Borders, Outlines and Shadows
The border-image-outset property
Reference for the CSS border-image-outset property: push a border image outward past the border box with numbers or lengths, with a live example and notes.
The border-image-outset property moves the border image outward, away from the border box. With an outset of 0 (the default) the image sits exactly on the border. With a positive outset the image area grows on every chosen side, so the frame is drawn partly or completely outside the box.
The outset is purely visual. It does not push neighbouring elements away, does not add scrolling space and cannot be clicked: nearby content may be painted over by the image. Leave enough margin when you use it.
.frame { border-image-outset: 10px; }
Try it
Syntax
border-image-outset: [ <length [0,โ]> | <number [0,โ]> ]{1,4};
- Initial value:
0 - Applies to: all elements, except internal table elements when
border-collapseiscollapse - Inherited: no
- Animatable: yes, by computed value
- Computed value: four values, each a number or an absolute length
Values
| Value | Description |
|---|---|
<length> |
A distance outward, such as 8px. Negative values are invalid. |
<number> |
A multiple of the matching border-width. 1 pushes the image out by one full border width. |
| One to four values | Top, right, bottom, left, in the same pattern as margin. |
Usage notes
- No percentages. Only lengths and plain numbers are allowed.
- Overflow. The extended image is painted outside the box, so an ancestor with
overflow: hiddencan clip it. - Spacing. Because it takes no layout space, add margin so the frame does not collide with siblings.
- Typical use. A decorative frame that should not shrink the content, or a gradient "glow" ring around a button.
- Not the same as
outline-offset. Anoutlinecan be moved away withoutline-offsetand follows rounded corners; a border image outset draws a square image.
Browser support
Supported in every current browser.
Related
border-imageโ the shorthandborder-image-source,border-image-slice,border-image-width,border-image-repeat- Lesson: Border Images