CSS Border Width

How to control the thickness of the border using style sheet?

Explanation

Property :

Border Width

Usage:


border-width: 5px;
border-width: 5pt;
border-width: 2%;

Definition:

The border width of any object can be set with any width using the tag/argument border-width. border-width will not take effect with out border style. Border style can be set using "border-style"
Border Width takes the following values.
a)5px : The border width can be set in pixels.
b)5pt : The border width can be set in points.
c)1% : The border width can be set in percentage.

Example 1:



<div style="border-width: 4px; border-style: solid; border-color: red; ">testing border width</div>
Result:

testing border width


Example 2:


<font style="border-width: 5pt; border-style: solid; border-color: #454545;">testing border width</font>
Result:

testing border width

Example 3:


<div style="border-width: 2%; border-style: solid; border-color: rgb(125,125,125);">testing border width</div>
Result:

testing border width


Ask Questions

Ask Question