CSS Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
CSS Topics
css tutorials Introduction
Types Types
Background Properties Background Properties
Text Properties Text Properties
Font Properties Font Properties
Box Properties BOX Properties
Border Properties Border Properties
Margin Properties Margin Properties
Padding Properties Padding Properties
Special Topics Special Topics
Forums Ask Your Doubts
Scraps More about CSS
Feedback Feedback
 




CSS Border Width


Tutorials »Css »

Topic

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



Border color Border style



A Note
CSS - Cascading Style Sheets can be used along with html tags as explained in this site. This simple CSS will help you to create much elegant and neat html web pages. This does not need any additional softwares or codings. All web browser are capable of handing CSS codes.

Note 2: If required you can using <span> instead of <div> tags. div tag will start and end on new lines. span will not exceed the tag area.
Other Links

web hosting