CSS border-bottom-style Property
The border-bottom-style property sets the line style of an element's physical bottom border.
It determines whether the bottom border appears as a solid, dashed, dotted, double, or three-dimensional line. The property controls only the border style, while border-bottom-width and border-bottom-color control its thickness and color.
border-bottom-style Syntax
selector {
border-bottom-style: solid;
}
The property accepts one border style keyword or a CSS-wide keyword.
.no-border {
border-bottom-style: none;
}
.hidden-border {
border-bottom-style: hidden;
}
.dotted-border {
border-bottom-style: dotted;
}
.dashed-border {
border-bottom-style: dashed;
}
.solid-border {
border-bottom-style: solid;
}
.double-border {
border-bottom-style: double;
}
.groove-border {
border-bottom-style: groove;
}
.ridge-border {
border-bottom-style: ridge;
}
.inset-border {
border-bottom-style: inset;
}
.outset-border {
border-bottom-style: outset;
}
CSS-wide keywords are also supported:
.inherited {
border-bottom-style: inherit;
}
.reset {
border-bottom-style: initial;
}
.unset {
border-bottom-style: unset;
}
.reverted {
border-bottom-style: revert;
}
.layer-reverted {
border-bottom-style: revert-layer;
}
Only one border style keyword is permitted. Multiple styles in the same declaration are invalid.
Property Values
| Value | Description |
|---|---|
none |
Displays no bottom border and gives it a used width of zero. This is the initial value. |
hidden |
Suppresses the bottom border and gives it a used width of zero. It has special behavior in collapsed table borders. |
dotted |
Displays a series of dots along the bottom border. |
dashed |
Displays a series of short line segments. |
solid |
Displays a single continuous line. |
double |
Displays two parallel lines separated by a gap. |
groove |
Creates a shaded border that appears carved into the surface. |
ridge |
Creates a shaded border that appears raised above the surface. |
inset |
Creates a shaded border that makes the element appear recessed. |
outset |
Creates a shaded border that makes the element appear raised. |
CSS-Wide Keywords
| Keyword | Behavior |
|---|---|
inherit |
Uses the parent's computed bottom border style. |
initial |
Resets the style to none. |
unset |
Resets the style to none because the property is not inherited. |
revert |
Reverts the property according to cascade origin rules. |
revert-layer |
Reverts the property according to cascade layer rules. |
The property is not inherited, has an initial value of none, and uses discrete animation rather than gradual interpolation between border styles.
How It Works
The border-bottom-style property determines how the bottom border is drawn. A visible style is necessary for the border to appear.
Setting a Solid Bottom Border
.panel {
border-bottom-style: solid;
border-bottom-width: 4px;
border-bottom-color: #1769aa;
}
The element receives a 4-pixel solid blue bottom border.
Changing the Border Style
.panel {
border-bottom: 4px solid #1769aa;
border-bottom-style: dashed;
}
The later declaration changes the bottom border from solid to dashed while preserving its specified width and color.
Using the Default Width
.panel {
border-bottom-style: solid;
border-bottom-color: #1769aa;
}
Without an explicit width, the border uses the initial medium width.
Using the Default Color
.panel {
color: #1769aa;
border-bottom-style: solid;
border-bottom-width: 3px;
}
The bottom border uses currentColor, matching the element's computed text color.
Removing an Existing Border
.panel {
border-bottom: 4px solid #1769aa;
border-bottom-style: none;
}
The bottom border is no longer painted, and its used width becomes zero.
Available Border Styles
CSS provides ten border style keywords. Each controls how the bottom edge is painted.
none
.example {
border-bottom: 6px none #1769aa;
}
No bottom border is drawn. Its used width is zero, regardless of the specified width.
hidden
.example {
border-bottom: 6px hidden #1769aa;
}
No bottom border is drawn. Unlike none, hidden suppresses competing borders in the collapsed table border model.
dotted
.example {
border-bottom: 6px dotted #1769aa;
}
The bottom border consists of dots. Their shape and spacing can vary between browsers.
dashed
.example {
border-bottom: 6px dashed #1769aa;
}
The bottom border consists of short line segments separated by gaps. Dash lengths and spacing are browser-dependent.
solid
.example {
border-bottom: 6px solid #1769aa;
}
The bottom border appears as a continuous line.
double
.example {
border-bottom: 6px double #1769aa;
}
The bottom border consists of two parallel lines with a gap between them. The total thickness, including the gap, fits within the specified border width.
groove
.example {
border-bottom: 6px groove #1769aa;
}
Shading gives the border a carved or recessed appearance.
ridge
.example {
border-bottom: 6px ridge #1769aa;
}
Shading gives the border a raised or ridged appearance.
inset
.example {
border-bottom: 6px inset #1769aa;
}
The border uses shading associated with a recessed element.
outset
.example {
border-bottom: 6px outset #1769aa;
}
The border uses shading associated with a raised element.
For consistent, simple separators, solid, dashed, and dotted are generally the most predictable choices.
none vs. hidden
Both none and hidden prevent a bottom border from appearing, but they differ when table borders are collapsed.
Using none
.panel {
border-bottom-width: 5px;
border-bottom-style: none;
}
The used border width is zero. In a collapsed table, a competing visible border may still be displayed.
Using hidden
.panel {
border-bottom-width: 5px;
border-bottom-style: hidden;
}
The used border width is also zero. In a collapsed table, hidden takes precedence and suppresses competing borders at the shared edge.
Comparison
| Behavior | none |
hidden |
|---|---|---|
| Paints a border | No | No |
| Used border width | Zero | Zero |
| Suppresses competing collapsed table borders | No | Yes |
| Initial value | Yes | No |
For ordinary elements, the two values usually produce the same visible result. Their important distinction appears in collapsed table border conflict resolution.
Border Width and Color
The bottom border's appearance depends on three related properties: style, width, and color.
Separate Longhand Properties
.panel {
border-bottom-style: dashed;
border-bottom-width: 4px;
border-bottom-color: #1769aa;
}
This creates a 4-pixel dashed blue bottom border.
Equivalent Shorthand
.panel {
border-bottom: 4px dashed #1769aa;
}
The border-bottom shorthand combines the three properties in one declaration.
Changing Only the Style
.panel {
border-bottom: 4px solid #1769aa;
border-bottom-style: dotted;
}
The border becomes dotted without changing its specified thickness or color.
Width Without a Visible Style
.panel {
border-bottom-width: 6px;
border-bottom-color: #1769aa;
}
If no other style declaration applies, the border remains invisible because the initial style is none.
Zero Width
.panel {
border-bottom-width: 0;
border-bottom-style: solid;
border-bottom-color: #1769aa;
}
The border has no visible thickness, even though its style is solid.
Transparent Color
.panel {
border-bottom: 4px solid transparent;
}
The border is invisible but retains its 4-pixel used width. This differs from setting its style to none.
Three-Dimensional Border Styles
The groove, ridge, inset, and outset styles use shading to create an impression of depth.
groove and ridge
.groove-example {
border-bottom: 8px groove #1769aa;
}
.ridge-example {
border-bottom: 8px ridge #1769aa;
}
groove produces a recessed appearance, while ridge produces a raised appearance. Their shading is related but reversed.
inset and outset
.inset-example {
border-bottom: 8px inset #1769aa;
}
.outset-example {
border-bottom: 8px outset #1769aa;
}
inset uses shading associated with a sunken element, while outset uses shading associated with a raised element.
Border Thickness Matters
.thin-groove {
border-bottom: 1px groove #1769aa;
}
.thick-groove {
border-bottom: 10px groove #1769aa;
}
Very thin borders may not provide enough space for the shading effect to be clearly visible. Thicker borders generally make the effect easier to recognize.
The precise shading and rendering can vary between browsers. These styles are less suitable when an exact visual appearance is required.
Shorthand Interactions
The border-bottom-style longhand can be set or reset by several border shorthand properties.
Using border-bottom
.panel {
border-bottom: 4px solid #1769aa;
border-bottom-style: dashed;
}
The later longhand changes the style to dashed while retaining the specified width and color.
Shorthand After Longhand
.panel {
border-bottom-style: dashed;
border-bottom: 4px solid #1769aa;
}
The later shorthand replaces the dashed style with solid.
Omitting the Style from a Shorthand
.panel {
border-bottom-style: dashed;
border-bottom: 4px #1769aa;
}
The later shorthand resets the style to its initial value of none, making the border invisible.
Using border-style
.panel {
border-bottom-style: dashed;
border-style: solid;
}
The later border-style shorthand sets all four sides to solid, including the bottom border.
Four-Side border-style Values
.panel {
border-style: solid dashed dotted double;
}
The values apply clockwise: top is solid, right is dashed, bottom is dotted, and left is double.
Using the border Shorthand
.panel {
border-bottom-style: dashed;
border: 2px solid #777;
}
The later border shorthand sets all four border styles to solid.
These examples assume declarations with equal cascade priority. Specificity, importance, origins, and cascade layers can affect which declaration wins.
Logical vs. Physical Border Styles
The border-bottom-style property always targets the physical bottom edge. Logical border style properties follow the writing mode and text direction.
Physical Bottom Border
.physical {
writing-mode: vertical-rl;
border: 4px solid #1769aa;
border-bottom-style: dashed;
}
The physical bottom border becomes dashed, regardless of the writing mode.
Logical Border Mapping
| Writing Mode | Direction | Logical Property for Bottom Border |
|---|---|---|
horizontal-tb |
ltr or rtl |
border-block-end-style |
vertical-rl |
ltr |
border-inline-end-style |
vertical-rl |
rtl |
border-inline-start-style |
vertical-lr |
ltr |
border-inline-end-style |
vertical-lr |
rtl |
border-inline-start-style |
Horizontal Writing Mode
.logical {
writing-mode: horizontal-tb;
border: 4px solid #1769aa;
border-block-end-style: dashed;
}
In horizontal writing, the block-end edge is the physical bottom edge.
Vertical Writing Mode
.logical {
writing-mode: vertical-rl;
direction: ltr;
border: 4px solid #1769aa;
border-inline-end-style: dashed;
}
With vertical-rl and direction: ltr, the inline-end edge maps to the physical bottom border.
Use border-bottom-style for a fixed physical bottom border. Use logical properties when the affected edge should adapt to the writing mode.
Tables and Collapsed Borders
Table borders behave differently when border-collapse: collapse is used. Adjacent cells share borders, and the browser resolves conflicts between competing declarations.
Collapsed Table Borders
table {
border-collapse: collapse;
}
td {
border: 2px solid #777;
}
Adjacent cells share a single border rather than displaying two separate borders.
Using hidden
td.special {
border-bottom-style: hidden;
}
The hidden style suppresses the competing collapsed border along the affected edge.
Using none
td.special {
border-bottom-style: none;
}
The none style does not suppress a competing visible border. A neighboring cell's border may still appear along the shared edge.
Style Precedence
When collapsed borders conflict and no hidden border is involved, border width is considered before style precedence. For otherwise comparable borders, the style priority is:
double, solid, dashed, dotted, ridge, outset, groove, and inset.
The hidden style takes precedence over all other styles and suppresses the shared border. The none style has the lowest priority.
In collapsed tables, inset is treated like ridge, and outset is treated like groove for border rendering.
Practical Uses
Bottom border styles are useful for navigation indicators, section dividers, headings, and form controls.
Section Divider
.section-heading {
border-bottom: 2px solid #1769aa;
padding-bottom: 10px;
}
A solid bottom border provides a clear separation between a heading and its content.
Dashed Divider
.content-section {
border-bottom: 2px dashed #aab8c5;
padding-bottom: 20px;
}
A dashed border creates a less continuous visual separator.
Dotted Divider
.content-item {
border-bottom: 2px dotted #777;
padding-bottom: 12px;
}
Dotted borders can separate repeated content items without a solid dividing line.
Active Navigation Link
.nav-link {
border-bottom: 3px solid transparent;
}
.nav-link[aria-current="page"] {
border-bottom-color: #1769aa;
}
The transparent border reserves space for the active indicator, preventing a change in border thickness when the link becomes active.
Input Underline
.underline-input {
border: none;
border-bottom: 2px solid #777;
}
.underline-input:focus-visible {
border-bottom-style: double;
border-bottom-width: 4px;
border-bottom-color: #1769aa;
outline: 2px solid #1769aa;
outline-offset: 2px;
}
The input uses a bottom border for its default appearance. A distinct border and outline help identify keyboard focus.
border-bottom-style Example
The following example displays all ten border style keywords using the same width and color for comparison.
<div class="bottom-style-demo">
<div class="demo-box none">none</div>
<div class="demo-box hidden">hidden</div>
<div class="demo-box dotted">dotted</div>
<div class="demo-box dashed">dashed</div>
<div class="demo-box solid">solid</div>
<div class="demo-box double">double</div>
<div class="demo-box groove">groove</div>
<div class="demo-box ridge">ridge</div>
<div class="demo-box inset">inset</div>
<div class="demo-box outset">outset</div>
</div>
.bottom-style-demo {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 16px;
}
.bottom-style-demo .demo-box {
box-sizing: border-box;
min-height: 90px;
padding: 25px 12px 12px;
border-bottom-width: 8px;
border-bottom-color: #1769aa;
background-color: #e8f2fb;
color: #173b5e;
font-weight: bold;
text-align: center;
}
.bottom-style-demo .none {
border-bottom-style: none;
}
.bottom-style-demo .hidden {
border-bottom-style: hidden;
}
.bottom-style-demo .dotted {
border-bottom-style: dotted;
}
.bottom-style-demo .dashed {
border-bottom-style: dashed;
}
.bottom-style-demo .solid {
border-bottom-style: solid;
}
.bottom-style-demo .double {
border-bottom-style: double;
}
.bottom-style-demo .groove {
border-bottom-style: groove;
}
.bottom-style-demo .ridge {
border-bottom-style: ridge;
}
.bottom-style-demo .inset {
border-bottom-style: inset;
}
.bottom-style-demo .outset {
border-bottom-style: outset;
}
The none and hidden examples display no bottom border. Both have a used border width of zero.
The dotted, dashed, solid, and double examples demonstrate different line patterns.
The remaining four styles use shading to create three-dimensional effects. Their exact appearance may differ between browsers.
Important Considerations
Keep the following points in mind when using border-bottom-style:
- Physical edge: Always controls the physical bottom border, regardless of writing mode.
- Initial value: The initial style is
none. - Inheritance: The property is not inherited.
- Available styles: Ten border style keywords are supported.
- One value: Only a single style keyword is accepted.
- Visible border: A visible style and nonzero used width are required for a border to appear.
- Default width: When a visible style is specified without a width, the initial width is
medium. - Default color: The initial border color is
currentColor. - none: Suppresses the border and gives it a used width of zero.
- hidden: Also suppresses the border but takes precedence in collapsed table border conflicts.
- Transparent borders: A transparent border with a visible style and nonzero width still occupies space.
- double: The two lines and the gap fit within the total border width.
- Dotted and dashed rendering: Dot shapes, dash lengths, and spacing may vary between browsers.
- Three-dimensional styles: Shading effects can vary depending on the browser and border color.
- Shorthand interactions: Later border shorthand declarations may reset the style.
- Logical alternatives: Use logical border style properties when the edge should follow the writing mode.
- Animation: Border style changes are discrete rather than smoothly interpolated.
- Accessibility: Do not rely on border style alone to communicate important information.
Use border-bottom-style when the appearance of the physical bottom border needs to change without resetting its specified width or color.
Browser Support
The border-bottom-style property is widely supported across Chrome, Edge, Firefox, Safari, and other major browsers, including older browser versions.
The standard property does not require vendor prefixes. Minor visual differences may occur in dotted, dashed, and three-dimensional border styles.
Standard Declaration
.panel {
border-bottom-style: solid;
border-bottom-width: 4px;
border-bottom-color: #1769aa;
}
Alternative Style
.panel {
border-bottom-style: dashed;
}
Both declarations use standard CSS supported by modern browsers.
Visit Can I Use? and search for border-bottom-style to review browser compatibility.
Specifications
The border-bottom-style property is defined in the CSS Backgrounds and Borders Module Level 3 specification.
CSS Backgrounds and Borders Module Level 3
Logical border style properties are defined in the CSS Logical Properties and Values Module Level 1 specification.
