CSS border-image-source Property

You are Here:

CSS border-image-source Property

CSS border-image-source property sets the source image used to create an element's border image.

Example

HTML Online Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ border: 50px solid transparent; padding: 15px; width: 250px; margin: 25px; border-image-source: url(car-left.png); border-image-repeat: repeat; } </style> </head> <body> <h1>CSS border-image-source Property</h1> <div> border-image-source: url(car-left.png); </div> </body> </html>

Syntax

Using CSS

element{ border-image-source: url(car-left.png); }

Using Javascript

object.style.borderImageSource="url(car-left.png)";

Animatable

No, border-image-source property is not animatable. CSS Animatable Properties Reference.

Default Value

Default value for CSS border-image-source property is none.

Property Value

The following table provides a list of values for CSS border-image-source property.

ValueExplanation
noneNo image will be used.
imageSpecifies the path to the image to be used as a border.

Using JavaScript

In the following example, we will demonstrate how to remove the CSS border-image-source property of an element using JavaScript.

Example

HTML Online Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ border: 50px solid transparent; padding: 15px; width: 150px; margin: 25px; text-align: center; border-image-source: url(car-left.png); border-image-repeat: repeat; } </style> </head> <body> <h1>CSS border-image-source Property</h1> <div> This is div container. </div> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("div")[0]; function myFunction(){ x.style.borderImageSource = "none"; } </script> </body> </html>

Reminder

Hi Developers, we almost covered 98.7% of CSS Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in CSS.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author