CSS - border-image
border-image
You can set an image to the border of your element using the border-image css property.
border-image is also a shorthand property for the border-image-* properties.
Property Variable Name
border-image
Available Values for border-image
url(https://css.kruxor.com/images/pexels-johannes-rapprich-4996652-1200.jpg) 30 round|initial|inherit
Examples Using border-image values
Example using border-image url(https://css.kruxor.com/images/pexels-johannes-rapprich-4996652-1200.jpg) 30 round
Example using border-image url(https://css.kruxor.com/images/pexels-johannes-rapprich-4996652-1200.jpg) 30 round
Here is an example using border-image:url(https://css.kruxor.com/images/pexels-johannes-rapprich-4996652-1200.jpg) 30 round;
Code
<style>
/* Some Styles so we can see the element */
.rainbow {
background:linear-gradient(45deg, #dc3b3e, #3b99dc 50%, #3bdc90 75%, rgb(255 141 0) 100%);
}
.demo-box-1 {
background:#999;
margin-bottom:10px;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
color:#FFF;
align-items: center;
justify-content: center;
border:5px solid #000;
}
.demo-box-1 {
/* this is the test property */
border-image:url(https://css.kruxor.com/images/pexels-johannes-rapprich-4996652-1200.jpg) 30 round;
}
</style>
<h2>Example using border-image url(https://css.kruxor.com/images/pexels-johannes-rapprich-4996652-1200.jpg) 30 round</h2>
<p>Here is an example using <code>border-image:url(https://css.kruxor.com/images/pexels-johannes-rapprich-4996652-1200.jpg) 30 round;</code></p>
<div class='rainbow demo-box-1'>
</div>
Example using border-image initial
Example using border-image initial
Here is an example using border-image:initial;
Code
<style>
/* Some Styles so we can see the element */
.rainbow {
background:linear-gradient(45deg, #dc3b3e, #3b99dc 50%, #3bdc90 75%, rgb(255 141 0) 100%);
}
.demo-box-2 {
background:#999;
margin-bottom:10px;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
color:#FFF;
align-items: center;
justify-content: center;
border:5px solid #000;
}
.demo-box-2 {
/* this is the test property */
border-image:initial;
}
</style>
<h2>Example using border-image initial</h2>
<p>Here is an example using <code>border-image:initial;</code></p>
<div class='rainbow demo-box-2'>
</div>
Example using border-image inherit
Example using border-image inherit
Here is an example using border-image:inherit;
Code
<style>
/* Some Styles so we can see the element */
.rainbow {
background:linear-gradient(45deg, #dc3b3e, #3b99dc 50%, #3bdc90 75%, rgb(255 141 0) 100%);
}
.demo-box-3 {
background:#999;
margin-bottom:10px;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
color:#FFF;
align-items: center;
justify-content: center;
border:5px solid #000;
}
.demo-box-3 {
/* this is the test property */
border-image:inherit;
}
</style>
<h2>Example using border-image inherit</h2>
<p>Here is an example using <code>border-image:inherit;</code></p>
<div class='rainbow demo-box-3'>
</div>