border-image-width
Quick Summary for border-image-width
The border-image-width CSS property sets the width of an element's border image.
Code Usage for border-image-width
/* Keyword value */ border-image-width: auto;  /* <length> value */ border-image-width: 1rem;  /* <percentage> value */ border-image-width: 25%;  /* <number> value */ border-image-width: 3;  /* vertical | horizontal */ border-image-width: 2em 3em;  /* top | horizontal | bottom */ border-image-width: 5% 15% 10%;  /* top | right | bottom | left */ border-image-width: 5% 2em 10% auto;  /* Global values */ border-image-width: inherit; border-image-width: initial; border-image-width: revert; border-image-width: unset; 
More Details for border-image-width

border-image-width

The border-image-width CSS property sets the width of an element's border image.

If this property's value is greater than the element's border-width, the border image will extend beyond the padding (and/or content) edge.

Syntax

/* Keyword value */ border-image-width: auto;  /* <length> value */ border-image-width: 1rem;  /* <percentage> value */ border-image-width: 25%;  /* <number> value */ border-image-width: 3;  /* vertical | horizontal */ border-image-width: 2em 3em;  /* top | horizontal | bottom */ border-image-width: 5% 15% 10%;  /* top | right | bottom | left */ border-image-width: 5% 2em 10% auto;  /* Global values */ border-image-width: inherit; border-image-width: initial; border-image-width: revert; border-image-width: unset; 

The border-image-width property may be specified using one, two, three, or four values chosen from the list of values below.

When one value is specified, it applies the same width to all four sides. When two values are specified, the first width applies to the top and bottom, the second to the left and right. When three values are specified, the first width applies to the top, the second to the left and right, the third to the bottom. When four values are specified, the widths apply to the top, right, bottom, and left in that order (clockwise).

Values

<length-percentage>

The width of the border, specified as a <length> or a <percentage>. Percentages are relative to the width of the border image area for horizontal offsets and the height of the border image area for vertical offsets. Must not be negative.

<number>

The width of the border, specified as a multiple of the corresponding border-width. Must not be negative.

auto

The width of the border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding border-image-slice. If the image does not have the required intrinsic dimension, the corresponding border-width is used instead.

Formal definition

Initial value1
Applies toall elements, except internal table elements when border-collapse is collapse. It also applies to ::first-letter.
Inheritedno
Percentagesrefer to the width or height of the border image area
Computed valueas specified, but with relative lengths converted into absolute lengths
Animation typeby computed value type

Formal syntax

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

where <length-percentage> = <length> | <percentage>

Examples

Tiling a border image

This example creates a border image using the following ".png" file, which is 90 by 90 pixels:

Thus, each circle in the source image is 30 by 30 pixels.

HTML
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy    eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.    At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,    no sea takimata sanctus est Lorem ipsum dolor sit amet.</p> 
CSS
p {   border: 20px solid;   border-image: url("border.png") 30 round;   border-image-width: 16px;   padding: 40px; } 
Result

Specifications

Specification
CSS Backgrounds and Borders Module Level 4 # the-border-image-width

See also

Backgrounds and borders Learn CSS: Backgrounds and borders

Last modified: Aug 12, 2021, by MDN contributors

Select your preferred language English (US)DeutschFrançais日本語한국어Русский中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote

"Olivia, my eldest daughter, caught measles when she was seven years old. As the illness took its usual course I can remember reading to her often in bed and not feeling particularly alarmed about it. Then one morning, when she was well on the road to recovery, I was sitting on her bed showing her how to fashion little animals out of coloured pipe-cleaners, and when it came to her turn to make one herself, I noticed that her fingers and her mind were not working together and she couldn’t do anything. 'Are you feeling all right?' I asked her. 'I feel all sleepy,' she said. In an hour, she was unconscious. In twelve hours she was dead. The measles had turned into a terrible thing called measles encephalitis and there was nothing the doctors could do to save her. That was...in 1962, but even now, if a child with measles happens to develop the same deadly reaction from measles as Olivia did, there would still be nothing the doctors could do to help her. On the other hand, there is today something that parents can do to make sure that this sort of tragedy does not happen to a child of theirs. They can insist that their child is immunised against measles. ...I dedicated two of my books to Olivia, the first was ‘James and the Giant Peach’. That was when she was still alive. The second was ‘The BFG’, dedicated to her memory after she had died from measles. You will see her name at the beginning of each of these books. And I know how happy she would be if only she could know that her death had helped to save a good deal of illness and death among other children."

I just checked google books for BFG, and the dedication is there. 

https://www.google.com.au/books/edition/_/quybcXrFhCIC?hl=en&gbpv=1 


Roald Dahl, 1986
Random CSS Property

max-height

The max-height CSS property sets the maximum height of an element. It prevents the used value of the height property from becoming larger than the value specified for max-height.
max-height css reference