How to set the width of the bottom border?
Solution:
HTML Code:
<!DOCTYPE html><!-- Declaration of HTML5 document type -->
<html>
<head>
<title>How to set the width of the bottom border</title><!-- Title of the HTML document -->
<style type="text/css">/* CSS style start*/
h1.xyz {
border-style: solid; /* Specifies a solid border style for the element */
border-bottom-width: 10px; /* Sets the width of the bottom border to 10px */
}
</style>
</head>
<body>
<h1 class="xyz">w3resource Tutorial</h1><!-- Heading element with class "xyz" -->
<p><b>Note:</b> The default value is medium none color.</p><!-- Paragraph element with a note about default border properties -->
</body>
</html>
Explanation:
- This HTML document demonstrates how to set the width of the bottom border of an element.
- The CSS style block applies styling to the <h1> element with the class "xyz".
- border-style: solid; specifies a solid border style for the element.
- border-bottom-width: 10px; sets the width of the bottom border to 10px.
- The heading <h1> with the class "xyz" will have a solid border with a width of 10px only at the bottom.
- The <p> element provides a note about the default border properties.
Live Demo:
See the Pen border-bottom-width-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/html-css-exercise/css-properties/border-bottom-width-answer.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics