Adding Different Border Styles To Creat a Good Web Design
Borders can be applied to almost any two-side tag particularly in a paragraph. You can specify line type of a border by using the border-style rule along with its line style.
CSS Property: border-style. The style of the border of a box. The border style, combined with border width and border color, can also be specified with the border shorthand property. With one value, the border-style property can be used to specify a uniform style border around a box.
CSS Property: border-style. The style of the border of a box. The border style, combined with border width and border color, can also be specified with the border shorthand property. With one value, the border-style property can be used to specify a uniform style border around a box.
Adding Border-Color
The border-color property is used to set the color of the borders and it can have one to four values.
Steps To Add Border-Color:
1.Open the characterspacing.html file in Notepad
2.Inside the <html></html> add the CSS code for border-color inside <head></head> and HTML code for border-color inside <body></body>.
CSS & HTML CODE
<html>
<head>
<style>
p.one {
border-style: solid;
border-color: red;
}
p.two {
border-style: solid;
border-color: green;
}
p.three {
border-style: solid;
border-color: red green blue yellow;
}
</style>
</head>
<body>
<p class="one">A solid red border</p>
<p class="two">A solid green border</p>
<p class="three">A solid multicolor border</p>
</body>
</html>
3.Save the files as pharagraph-border-color.html.
4.See what it looks like in a browser.
Sample output:
Steps To Add Border-Color:
1.Open the characterspacing.html file in Notepad
CSS & HTML CODE
Sample output:
A solid red border
A solid green border
A solid multicolor border
A solid red border
A solid green border
A solid multicolor border
Border Style
The border-style property specifies what kind if border to display.
The following values are allowed:
Steps To Create Border Style:
Border Style
The border-style property specifies what kind if border to display.
The following values are allowed:
The border-style property specifies what kind if border to display.
The following values are allowed:
1.Open characterspacing.html file in Notepad.
2.Type the following inside the <html></html> and type CSS code inside the <head></head> and HTML code inside the <body></body>.
CSS & HTML CODE
<html>
<head>
<style>
p.dotted {border-style: dotted;}
p.dashed {border-style: dashed;}
p.solid {border-style: solid;}
p.double {border-style: double;}
p.groove {border-style: groove;}
p.ridge {border-style: ridge;}
p.inset {border-style: inset;}
p.outset {border-style: outset;}
p.none {border-style: none;}
p.hidden {border-style: hidden;}
p.mix {border-style: dotted dashed solid double;}
</style>
</head>
<body>
<p class="dotted">A dotted border.</p>
<p class="dashed">A dashed border.</p>
<p class="solid">A solid border.</p>
<p class="double">A double border.</p>
<p class="groove">A groove border.</p>
<p class="ridge">A ridge border.</p>
<p class="inset">An inset border.</p>
<p class="outset">An outset border.</p>
<p class="none">No border.</p>
<p class="hidden">A hidden border.</p>
<p class="mix">A mixed border.</p>
</body>
</html>
3.Save the files as pharagraph-border.html.
4.See what it looks like in a browser.
Example output:
Example output:
A dotted border.
A dashed border.
A solid border.
A dotted border.
A dashed border.
A solid border.
A double border.
A groove border.
A ridge border.
An inset border.
An outset border.
No border.
A hidden border
A mixed border.
A double border.
A groove border.
A ridge border.
An inset border.
An outset border.
No border.
A hidden border
A mixed border.
