W3Schools.com

CSS Reference

CSS Reference
CSS Selectors
CSS Reference Aural
CSS Web Safe Fonts
CSS Units
CSS Colors
CSS Color Values
CSS Color Names
CSS Color HEX
CSS3 Browser Support

CSS Properties

CSS3 border-image Property

CSS Reference Complete CSS Reference

Example

Specify an image as the border around a div element:

div
{
-moz-border-image:url(border.png) 30 30 round; /* Firefox */
-webkit-border-image:url(border.png) 30 30 round; /* Safari */
-o-border-image:url(border.png) 30 30 round; /* Opera */
border-image:url(border.png) 30 30 round;
}

Try it yourself »
More examples at the bottom of this page.

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The border-image property is only supported in Chrome.

Firefox supports an alternative, the -moz-border-image property.

Opera supports an alternative, the -o-border-image property.

Safari supports an alternative, the -webkit-border-image property.


Definition and Usage

The border-image property is a shorthand property for setting the border-image-source, border-image-slice, border-image-width, border-image-outset and border-image-repeat properties.

Omitted values are set to their default values.

Tip: Use the border-image-* properties to construct beautiful scalable buttons!

Default value: none 100% 1 0 stretch
Inherited: no
Version: CSS3
JavaScript syntax: object.style.borderImage="url(border.png) 30 30 round"


Syntax

border-image: source slice width outset repeat;

Value Description Play it
border-image-source The path to the image to be used as a border
border-image-slice The inward offsets of the image-border
border-image-width The widths of the image-border
border-image-outset The amount by which the border image area extends beyond the border box
border-image-repeat Whether the image-border should be repeated, rounded or stretched Play it »


Examples

Try it Yourself - Examples

Border-image button
This example demonstrates how to create a button with the border-image property.


Related Pages

CSS3 tutorial: CSS3 Borders


CSS Reference Complete CSS Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE