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 Style


Tutorials Css

Topic

I want to have a dashed or dotted border in html?
I want a double line around my paragraph in html?
How to draw a ridge or groove styled border using style sheet?



Explanation

Property: Border Style

Usage:
border-style: dotted;
border-style: dashed;
border-style: solid;
border-style: double;
border-style: groove;
border-style: ridge;
border-style: inset;
border-style: outset;

Definition:
The style of the border can be set using the tag border-style. Border Style takes the following values.
a)dotted- This will create a border with dotted lines.
b)dashed- This will create a border with dashed lines.
c)solid- This will create a border with solid lines.
d)double- This will create a border containing double lines.
e)groove- This will create a border that will look like groove.
f)ridge- This will create a border that will look like ridge.
g)inset- This will create a border with the line looking inset.
h)outset- This will create a border with the line looking outset.

Example 1:
<div style="border-width: 2px; border-style: dotted; border-color: red; "> testing border style</div>

Result:

testing border style



Example 2:
<div style="border-width: 2px; border-style: dashed; border-color: red; "> testing border style</div>

Result:

testing border style



Example 3:
<div style="border-width: 2px; border-style: solid; border-color: red; "> testing border style</div>

Result:

testing border style



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

Result:

testing border style



Example 5:
<div style="border-width: 4px; border-style: groove; border-color: red; "> testing border style</div>

Result:

testing border style



Example 6:
<div style="border-width: 4px; border-style: ridge; border-color: red; "> testing border style</div>

Result:

testing border style



Example 7:
<div style="border-width: 4px; border-style: inset; border-color: red; "> testing border style</div>

Result:

testing border style



Example 8:
<div style="border-width: 4px; border-style: outset; border-color: red; "> testing border style</div>

Result:

testing border style



Border width Side borders



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