
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set image as a border for elements with CSS
CSS border-image property is used to add image border to some elements. You can try to run the following code to set the image as a border for elements:
Example
<html> <head> <style> #borderimg1 { border: 10px solid transparent; padding: 15px; border-image-source: url(/css/images/border.png); border-image-repeat: round; border-image-slice: 30; border-image-width: 10px; } #borderimg2 { border: 10px solid transparent; padding: 15px; border-image-source: url(/css/images/border.png); border-image-repeat: round; border-image-slice: 30; border-image-width: 20px; } #borderimg3 { border: 10px solid transparent; padding: 15px; border-image-source: url(/css/images/border.png); border-image-repeat: round; border-image-slice: 30; border-image-width: 30px; } </style> </head> <body> <p id = "borderimg1">This is image border example.</p> <p id = "borderimg2">This is image border example.</p> <p id = "borderimg3">This is image border example.</p> </body> </html>
- Related Questions & Answers
- Set the border image as rounded, repeated and stretched with CSS
- Set the border image width with CSS
- Set the width of image border with CSS
- Set background image as fixed with CSS
- Set dotted line for border with CSS
- Set dashed line for border with CSS
- Set a dotted line for the border with CSS
- Set a linear gradient as the background image with CSS
- Set a radial gradient as the background image with CSS
- Set image for bullet style with CSS
- Slice the border image with CSS
- How to set the image to be used as a border with JavaScript?
- Set border width with CSS
- Set Inset border with CSS
- Set Outset border with CSS
Advertisements