CKTIS / CSS
border-style — border line style
border-style sets the line style of the four physical border sides. It accepts one to four values; it does not set the color or specified thickness.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
border-style: <line-style>{1,4};
<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outsetborder-style is shorthand for border-top-style, border-right-style, border-bottom-style, and border-left-style. One value covers all sides; two mean top/bottom and right/left; three mean top, right/left, bottom; four mean top, right, bottom, left.
solid is a continuous line, dotted uses dots, dashed uses dashes, and double draws two lines plus a gap within the specified thickness. groove and ridge create recessed and raised ridges; inset and outset make the entire box appear sunken or raised.
Each side initially uses none; the property is not inherited. Both none and hidden mean no line and a computed width of zero. In collapsed-border tables, hidden additionally suppresses competing borders, unlike none.
Set color and thickness with border-color and border-width. Setting thickness alone will not reveal a line styled none. Dot spacing, dash spacing, and three-dimensional shading can vary between browsers.
Examples
<!doctype html>
<meta charset="utf-8">
<title>border-style</title>
<style>
.box {
width: 160px;
padding: 12px;
border-width: 6px;
border-color: navy;
border-style: solid dashed double none;
}
</style>
<div class="box">border-style</div>Result
top: solid, 6px; right: dashed, 6px; bottom: double, 6px; left: none, 0px
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.