HTML CSS SQL Meta tag Generator ScrollBar design Generator Encode Decode images

CSS Basics

Introduction Syntax Selectors Attribute Selectors Specificity Combinators !important Comments Colors

CSS Need to Know

Box Model Pseudo-class Pseudo-element Inline-block Math Functions Max and Min Opacity Outline Overflow Z-index Float

Most used

Align Backgrounds Borders Text Units Padding Margins Position Tables Display Fonts Lists Height and Width

CSS Reference

CSS Properties reference CSS Pseudo-Classes reference CSS Pseudo-Elements reference CSS Selector reference

CSS border-image-slice

The border-image-slice property in CSS allows you to specify how to slice an image for use as a border. By dividing the image into sections, you can create borders with varying widths and patterns.

The border-image-slice property takes a four-value syntax, representing the distance inward from the top, right, bottom, and left edges of the border image, respectively. These values determine how much of the image will be used to create the border.

Let's take a look at an example to better understand how border-image-slice works:

Result:

  .border {
    border-image-source: url('border-image.png');
    border-image-slice: 30 fill;
    border-image-width: 30;
    border-image-outset: 10;
    border-image-repeat: stretch;
  }
  
This is a sample text with a border image applied.

In the example above, we have created a class named .border with the border-image-slice property set to 30 fill. This means that the border image will be sliced 30 pixels from each edge, and the center will be filled with the border image. The border-image-width property sets the width of the border, while border-image-outset specifies how much the border image will extend beyond the border box. Lastly, border-image-repeat determines how the border image is repeated or stretched to fill the border.

By adjusting the values of border-image-slice and other related properties, you can create custom borders with unique patterns and styles using CSS.

#ikea {
	display: table;
}