To create border images in CSS, use the border-image property. Following is the code to create border images in CSS −
Example
<!DOCTYPE html> <html> <head> <style> body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .border1 { border: 10px solid transparent; padding: 15px; border-image: url("https://i.picsum.photos/id/677/200/300.jpg") 30 round; } .border2 { border: 10px solid transparent; padding: 15px; border-image: url("https://i.picsum.photos/id/677/200/300.jpg") 2% round; } </style> </head> <body> <h1>Border image in CSS</h1> <p class="border1">Some random sample text inside the paragraph</p> <p class="border2">Some random sample text inside the paragraph</p> </body> </html>
Output
The above code will produce the following output −