Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/myscript/public_html/classes/classdb.php on line 42
CSS (HTML) Tutorial - Border width or size using style sheet

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