Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Change the width of the bottom border with CSS
The border-bottom-width CSS property controls the thickness of an element's bottom border. This property only works when a border style is defined, as borders are invisible by default.
Syntax
border-bottom-width: value;
Common values include thin, medium, thick, or specific measurements like 1px, 5px, 0.5em.
Example
<html>
<head>
</head>
<body>
<p style="border-bottom-width:6px; border-style:solid;">
This is demo content with a 6px bottom border.
</p>
</body>
</html>
Multiple Width Examples
<html>
<head>
<style>
.thin-border { border-bottom-width: thin; border-style: solid; }
.medium-border { border-bottom-width: medium; border-style: solid; }
.thick-border { border-bottom-width: thick; border-style: solid; }
.custom-border { border-bottom-width: 10px; border-style: solid; color: blue; }
</style>
</head>
<body>
<p class="thin-border">Thin bottom border</p>
<p class="medium-border">Medium bottom border</p>
<p class="thick-border">Thick bottom border</p>
<p class="custom-border">Custom 10px bottom border</p>
</body>
</html>
Key Points
-
border-stylemust be set for the width to be visible - Default value is
medium(typically 3px) - Can use keywords:
thin,medium,thick - Accepts length values:
px,em,rem, etc.
Conclusion
The border-bottom-width property provides precise control over bottom border thickness. Remember to always specify border-style to make the border visible.
Advertisements
