CSS Tutorial
Menu
CSS Advanced
Menu
CSS Responsive
Menu
CSS Grid
Menu
CSS Border Images
border-image Property
The CSS border-image property specifies an image to be used instead of the normal border around an element.
The property consists of three parts:
- The image to be used as the border.
- Where to slice the image.
- Specify whether the middle sections be repeated or stretched.
The border-image property uses the image and slices it into nine sections, like a tic-tac-toe board. Then, the corners are placed at the corners, and the middle sections are repeated or stretched as you specify.
HTML
The border-image Property
Here, the middle sections of the image are repeated to create the border:
border-image: url(border.png) 30 round;
CSS
#borderimg {
border: 10px solid transparent;
padding: 15px;
border-image: url(border.png) 30 round;
}
Output
