HTML Code:
<!DOCTYPE html><!-- Declaration of HTML5 document type -->
<html>
<head>
<title>How to specify the size of the border-width</title><!-- Title of the HTML document -->
<style>
/* CSS styling */
#img1 {
border: 15px solid transparent; /* Sets a transparent solid border with 15px width for the element with id "img1" */
padding: 15px; /* Adds 15px padding to the element with id "img1" */
border-image-source: url("https://www.w3resource.com/w3r_images/border.png"); /* Specifies the border image source */
border-image-repeat: round; /* Sets the border image to be repeated and rounded */
border-image-slice: 30; /* Sets the size of the border image slices to 30 */
border-image-width: 20px; /* Sets the size of the border image width to 20px */
}
</style>
</head>
<body>
<p id="img1">border-image-width: 20px;</p><!-- Displays the text "border-image-width: 20px;" with the specified border image width -->
</body>
</html>
Explanation:
Live Demo:
See the Pen border-image-width-length-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4