CSS Borders
An element's border has a style, a width, and a color, and the CSS border properties control all three.
CSS Border Style
Which kind of border appears is decided by border-style.
It accepts these values:
dotted— a border made of dots.dashed— a border made of dashes.solid— a single solid line.double— a double line.groove— a 3D grooved look that varies with the border color.ridge— a 3D ridged look that varies with the border color.inset— a 3D inset look that varies with the border color.outset— a 3D outset look that varies with the border color.none— no border at all.hidden— the border is hidden.
You can give border-style one to four values, covering the top, right, bottom, and left borders.
Note: Until border-style is set, the other border properties do nothing.
Example
Every paragraph below has its own border style.
Prompt
An HTML page that demonstrates all the CSS border-style values.
In an internal
<style> block, make paragraph classes for each style: dotted, dashed, solid, double, groove, ridge, inset, outset, none, hidden, and a mixed one (dotted dashed solid double). Add a paragraph for each so every border style is shown.
Output: complete HTML page
index.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<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. The effect depends on the border-color value.</p>
<p class="ridge">A ridge border. The effect depends on the border-color value.</p>
<p class="inset">An inset border. The effect depends on the border-color value.</p>
<p class="outset">An outset border. The effect depends on the border-color value.</p>
<p class="none">No border.</p>
<p class="hidden">A hidden border.</p>
<p class="mix">A mixed border.</p>
</body>
</html>