The border-image-source property chooses the image or gradient that becomes your element’s border artwork.
01
Image URLs
PNG, JPG, SVG.
02
Gradients
Linear and radial.
03
none
Disable image border.
04
Longhand
Part of border-image.
05
With slice
Needs companion props.
06
Decorative
Frames and patterns.
Fundamentals
Definition and Usage
The border-image-source CSS property sets which image or gradient is used as the source for a border image. It is a longhand of the border-image shorthand and defines the artwork before slicing, repeating, and sizing are applied.
With border-image-source, you can move beyond plain solid, dashed, or dotted borders and use decorative frame images or colorful gradients. The source alone does not paint the border — you also need a border width and typically a border-image-slice value.
💡
Beginner Tip
Think of border-image-source as picking the wallpaper for a picture frame. You still need to decide how thick the frame is (border width) and how to cut the wallpaper into pieces (border-image-slice).
The default value of border-image-source is none. When set to none, no image border is used and the element falls back to the standard border-style, border-width, and border-color properties.
Reference
💎 Property Values
Value
Example
Meaning
url()
border-image-source: url("frame.png");
Uses an external image file as the border artwork
Gradient
border-image-source: linear-gradient(...);
Creates a gradient-based border without an image file
none
border-image-source: none;
Disables border image and uses normal border properties
Common Value Types
url(...)image file
linear-gradient(...)gradient source
nonenormal border
Compare
border-image-source vs related properties
Property
Targets
Best for
border-image-source
Which image or gradient to use
Choosing border artwork
border-image-slice
How the source is divided
Cutting frame corners and edges
background-image
Element background area
Content behind the element, not the border ring
border-image
Full border image shorthand
Setting source, slice, width, outset, and repeat together
Preview
👀 Live Preview
A box using an image as its border source:
Uses border-image-source: url("/images/apple.png"); with border-image-slice: 30;.
Hands-On
Examples Gallery
Try border-image-source with image URLs, gradients, and the none value.
📚 Image and Gradient Sources
Set the artwork that becomes your border image.
Example 1 — Image URL Source
Use an image file as the border source, matching the reference tutorial example.
border-image-source points to the image file. Combined with a border width and slice value, the browser maps regions of that image to the element’s border edges.
Example 2 — Linear Gradient Source
Use a CSS gradient instead of an image file for a colorful border.
Gradients are valid border image sources. A slice of 1 is a common pattern for gradient borders because it divides the gradient cleanly across the border area.
🎨 More Source Options
Radial gradients and disabling the border image.
Example 3 — Radial Gradient Source
Create a circular color transition as the border artwork.
When border-image-source is none, the browser ignores border-image painting and uses your normal border properties instead.
🧠 How border-image-source Works
1
You set a source
Choose an image URL or gradient with border-image-source.
Source
2
Border width reserves space
A visible border width defines how thick the image border will be.
Width
3
Slice divides the artwork
border-image-slice cuts the source into corners and edges.
Slice
=
🖼️
Decorative border painted
The chosen source appears as a custom border around the element.
Compatibility
Modern Browser Support
The border-image-source property is supported in all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera.
✓ Baseline · Modern browsers
Border image sources in today’s browsers
Image URLs and CSS gradients both work as border-image-source values in current browser versions.
96%Modern browser support
Google Chrome15+ · Desktop & Mobile
Full support
Mozilla Firefox15+ · Desktop & Mobile
Full support
Apple Safari6+ · macOS & iOS
Full support
Microsoft Edge12+ · All versions
Full support
Opera15+ · Modern versions
Full support
border-image-source property96% supported
Bottom line: Use border-image-source for image and gradient borders in modern projects. Test gradient borders in Safari if you need pixel-perfect results.
Wrap Up
Conclusion
The border-image-source property is where border-image styling begins. It lets you choose any image file or CSS gradient as border artwork, opening up decorative frames and colorful gradient borders that standard border properties cannot achieve alone.
Remember to pair it with border width and slice values so the browser can actually paint your chosen source around the element.
Use border: 10px solid transparent when applying image borders
Set border-image-slice alongside your source
Use gradients for lightweight colorful borders without extra HTTP requests
Optimize image files used as border sources
Design frame artwork with clear corner and edge regions
❌ Don’t
Expect border-image-source alone to show a border image
Confuse border-image-source with background-image
Use huge unoptimized images for small decorative borders
Forget to test gradient borders across browsers
Leave border-width at zero when using border images
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about border-image-source
Use these points when choosing border artwork.
5
Core concepts
🖼️01
Sets artwork
Image or gradient.
Purpose
⚡02
Default none
Normal border.
Default
🎨03
url() works
PNG, JPG, SVG.
Values
🌈04
Gradients OK
No image file.
Gradients
🛠05
Needs slice
Not standalone.
Usage
❓ Frequently Asked Questions
The border-image-source property sets the image or gradient used as the border artwork. It is the first step in applying a border-image — you choose what visual source the browser will slice and paint.
The initial value is none, which means no image border is used and the element falls back to normal border-style, border-width, and border-color.
Yes. linear-gradient() and radial-gradient() are valid sources in modern browsers and are a simple way to create colorful borders without an image file.
No. You also need a visible border width and usually border-image-slice so the browser knows how to divide and apply the source.
Common formats like PNG, JPEG, WebP, GIF, and SVG can be used with url() as long as the browser supports the format.