CSS <line-style> Data Type
The <line-style> data type is a line style keyword, such as solid, dashed, dotted, double, groove or none, used by borders and outlines.
Description
The <line-style> CSS data type represents the keywords that set the style of a line: solid, dashed, dotted, double and so on. It is used by border-style and its longhands, the border shorthands, outline-style (which also accepts auto but not hidden) and column-rule-style.
none and hidden both draw no line and give the border a width of zero; they only differ in tables with collapsed borders, where hidden wins over any other border style on the same edge while none has the lowest priority. dotted, dashed, solid and double draw the line itself; double needs a width of at least 3px to show two lines. groove, ridge, inset and outset create 3D-looking edges by drawing parts of the border in lighter and darker shades of its color; the exact rendering varies between browsers.
A border is only drawn when its style is something other than none or hidden. That is why border: 2px red shows nothing, while border: 2px solid red does: the initial value of border-style is none.
Examples:
.card { border: 1px solid #e2e8f0; }
.drop { border: 2px dashed #94a3b8; }
.focus { outline: 3px dotted #2563eb; }
.columns { column-rule: 1px double #cbd5e1; }
Interactive Demo
Syntax
<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset
Values
- noneNo line is drawn and the width computes to 0. In collapsed table borders it has the lowest priority.
- hiddenNo line is drawn and the width computes to 0. In collapsed table borders it has the highest priority. Not valid for outline-style.
- dottedA series of round dots.
- dashedA series of short line segments.
- solidA single, straight, solid line.
- doubleTwo straight lines with a gap between them, which together take up the border width.
- grooveLooks carved into the page; the opposite of ridge.
- ridgeLooks raised out of the page; the opposite of groove.
- insetMakes the box look embedded in the page; the opposite of outset.
- outsetMakes the box look raised out of the page; the opposite of inset.
Example
Browser Support
The following information will show you the current browser support for the CSS line-style data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





