Favorites

CSS <line-style> Data Type

<line-style>
CSS Data TypeThis data type is supported by all modern browsers.
Updated 21st November 2026

The <line-style> data type is a line style keyword, such as solid, dashed, dotted, double, groove or none, used by borders and outlines.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

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

Border
Demo Code
HTML Code
<div class="demo-element">Border</div>
CSS Code
.demo-element {
	width: 200px;
	padding: 20px;
	border: 10px solid #4361ee;
	background: #e7ecff;
	color: #1b1f3b;
	text-align: center;
	border-style: solid;
}

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

<div class="wrap">
<h1>CSS &lt;line-style&gt; examples</h1>
<div class="grid">
<div class="card">
<div class="box dotted">dotted</div>
<div class="label">border-style: dotted</div>
</div>
<div class="card">
<div class="box dashed">dashed</div>
<div class="label">border-style: dashed</div>
</div>
<div class="card">
<div class="box solid">solid</div>
<div class="label">border-style: solid</div>
</div>
<div class="card">
<div class="box double">double</div>
<div class="label">border-style: double</div>
</div>
<div class="card">
<div class="box groove">groove</div>
<div class="label">border-style: groove</div>
</div>
<div class="card">
<div class="box ridge">ridge</div>
<div class="label">border-style: ridge</div>
</div>
<div class="card">
<div class="box inset">inset</div>
<div class="label">border-style: inset</div>
</div>
<div class="card">
<div class="box outset">outset</div>
<div class="label">border-style: outset</div>
</div>
</div>
</div>
/* Base demo layout */
* { box-sizing: border-box; }

body {
  margin: 24px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f5f7fb;
  color: #102a43;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.08);
}

.label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  color: #486581;
  margin-top: 10px;
  word-break: break-word;
}

.note {
  font-size: 13px;
  color: #486581;
  margin-top: 14px;
}

/*  examples */
.box {
  height: 70px;
  display: grid;
  place-items: center;
  border: 6px #2563eb;
  border-radius: 6px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 13px;
}

.dotted { border-style: dotted; }
.dashed { border-style: dashed; }
.solid { border-style: solid; }
.double { border-style: double; }
.groove { border-style: groove; }
.ridge { border-style: ridge; }
.inset { border-style: inset; }
.outset { border-style: outset; }
Open in editor

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.

This data type is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.