CSS border-width Property
Demo
CSS border-width Property
CSS border-width
property sets the width of an element's border.
Example
Syntax
Using CSS
Using Javascript
Animatable
Yes, border-width property is animatable. CSS Animatable Properties Reference.
Default Value
Default value for CSS border-width property is medium.
Property Value
The following table provides a list of all values for CSS border-width
property.
Value | Explanation |
---|---|
thin | Specifies a thin border. |
medium | Specifies a medium border. |
thick | Specifies a thick border. |
length | Allows you to define the thickness of the border in any CSS length unit. |
All in One
In the following example, we will demonstrate all values of CSS border-width
property.
Example
Using JavaScript
In the following example, we will demonstrate how to change the CSS border-width
property of an element using JavaScript.
Example
CSS border-width is a shorthand CSS Property
The border-width
is a shorthand CSS Property of the following CSS properties.
The border-width
CSS property can have one, two, three, or four values.
- border-width: thin
- all four borders are thin
- border-width: thin medium
- top and bottom borders are thin
- right and left borders are medium
- border-width: thin medium thick
- top border is thin
- right and left borders are medium
- bottom border is thick
- border-width: thin medium thick 5px
- top border is thin
- right border is medium
- bottom border is thick
- left border is 5px
Reminder
Hi Developers, we almost covered 98.7% of CSS Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in CSS.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.