<?xml version="1.0" encoding="utf-8"?>

CSS border-image property

CSS border-image property Bad Practice
CSS border-image property Best Practice

If you're tired of plain boring borders, good news — CSS allows you to customize them fully. Use the border-image property to draw an image around an element that will replace its regular border. To add the image, specify its address with the url() function. You can tweak it if you want the image to be sliced, repeated, scaled, and stretched.[1]

In the example, the value 30 sets image offset to 30 pixels and the value round means that the image's edge regions are repeated to fill the gap between each border.

Pro Tip: You should also specify border width, style, and color with the border property anyway, in case the border image fails to load.

Improve your UX & Product skills with interactive courses that actually work