Tutorials

CSS 'border-image-slice' Property Explained

  • Published
  • 2 min read
  • CSS
  • HTML
  • Web Design
CSS 'border-image-slice' Property
In this article
  1. CSS 'border-image-slice' Property Examples
  2. Browser Support For 'border-image-slice' Property
  3. CSS Syntax of the 'border-image-slice' Property
  4. Usage of the 'border-image-slice' Property
  5. Property Values of the 'border-image-slice' Property

Corrected . The browser-support table was rebuilt from MDN browser-compat-data (unprefixed support, desktop browsers), checked 3 October 2026. Editorial approval is still pending.

The CSS 'border-image-slice' property divides the border image into nine regions: four corners, four edges, and a middle. This slicing tells the browser how to fit the border image around the element. The values define inward offsets from the image's top, right, bottom, and left edges, enabling the creation of flexible, scalable border designs that adapt to the element's size.

CSS 'border-image-slice' Property Examples

See the Pen CSS 'border-image-slice' Property by Webzstore (@webzstore) on CodePen.

The 'border-image-slice' property is essential for detailed control over border images, enabling designers to create complex, adaptive borders that enhance web elements' visual appeal and functionality.

Browser Support For 'border-image-slice' Property

Unprefixed support for the border-image-slice property (selected supported implementation, desktop browsers)
BrowserVersionReleased
Chrome15Oct 2011
Edge12Jul 2015
Firefox15Aug 2012
Safari6Jul 2012
Opera15Jul 2013

Source: MDN browser-compat-data 8.1.4, checked 3 October 2026. Prefixed support and implementations that were later removed are not counted, and some browsers list partial support or extra values. See the MDN reference for border-image-slice for the full compatibility details, including mobile browsers.

CSS Syntax of the 'border-image-slice' Property

border-image-slice: number | percentage | fill | initial | inherit;
  • A single value applies to all four sides.
  • Two values set the top and bottom first, then the left and right.
  • Three values are set at the top, left and right, and then the bottom.
  • Four values specify the top, right, bottom, and left offsets.
  • The fill keyword, if used, applies the slice to the element's background.

Usage of the 'border-image-slice' Property

Use 'border-image-slice' when you need to specify how an image is divided and scaled to be used as a border. This is particularly useful for complex or graphical borders that require precise control over how different parts of the image are used for the element's border. It allows designers to maintain the integrity of the border image's design while scaling it to fit various element sizes.

Property Values of the 'border-image-slice' Property

  • Number: Specifies the inward offsets from the edges of the image as a number, which represents pixels if the image is a raster image, or coordinates if the image is a vector image.
  • Percentage: Defines the offsets as a percentage of the image's size.
  • Fill: Includes the slice in the middle of the border image area, affecting the element's background.
  • Initial: Resets the 'border-image-slice' to its default value.
  • Inherit: Inherits the 'border-image-slice' from the parent element.

Share this article

Written by

Webzstore Team

Webzstore has helped businesses since 2010. Today, we bring websites, digital marketing and enquiry follow-up into practical plans built around the work each business needs.

Related services

Talk about your website or marketing

Book a Free 30-Minute Call

More tutorials

All tutorials

Privacy choices

Choose what this website may load. Your choice is saved on this device for up to 180 days. Privacy Policy

Turning a choice off stops further use of that optional service on this site. It does not take back information already sent, and we cannot delete cookies that other services set in your browser.