2021.02.17 12:43
border-style: none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|initial|inherit;
Value | Description | Play it |
---|---|---|
none | Default value. Specifies no border | Play it » |
hidden | The same as "none", except in border conflict resolution for table elements | Play it » |
dotted | Specifies a dotted border | Play it » |
dashed | Specifies a dashed border | Play it » |
solid | Specifies a solid border | Play it » |
double | Specifies a double border | Play it » |
groove | Specifies a 3D grooved border. The effect depends on the border-color value | Play it » |
ridge | Specifies a 3D ridged border. The effect depends on the border-color value | Play it » |
inset | Specifies a 3D inset border. The effect depends on the border-color value | Play it » |
outset | Specifies a 3D outset border. The effect depends on the border-color value | Play it » |
initial | Sets this property to its default value. Read about initial | Play it » |
inherit | Inherits this property from its parent element. Read about inherit |
A dashed border:
div {border-style: dashed;}
A solid border:
div {border-style: solid;}
A double border:
div {border-style: double;}
A groove border:
div {
border-style: groove;
border-color: coral;
border-width: 7px;
}
A ridge border:
div {
border-style: ridge;
border-color: coral;
border-width: 7px;
}
An inset border:
div {
border-style: inset;
border-color: coral;
border-width: 7px;
}
An outset border:
div {
border-style: outset;
border-color: coral;
border-width: 7px;
}
Set different borders on each side of an element:
p.one {border-style: dotted solid dashed double;}
p.two {border-style: dotted solid dashed;}
p.three {border-style: dotted solid;}
p.four {border-style: dotted;}
CSS tutorial: CSS Border
HTML DOM reference: borderStyle property