Tag border-bottom-style

🎨 CSS border-bottom-style: Defining the Look of the Bottom Border Line

Borders are key visual elements that separate content and add structure to your web pages. The border-bottom-styleproperty specifically controls how the bottom border line appears, giving you creative freedom to customize its style.


🧾 What is border-bottom-style?

The border-bottom-style CSS property sets the line style of the bottom border of an element. It determines whether the border is solid, dashed, dotted, double, or even invisible.


🧬 Syntax

selector {
border-bottom-style: none | solid | dashed | dotted | double | groove | ridge | inset | outset;
}

🔍 Available Styles

StyleDescriptionVisual Example
noneNo border line (invisible)
solidA single, solid line
dashedA line made of dashes– – – – – –
dottedA line made of dots· · · · · ·
doubleTwo solid lines with space in between
grooveAppears carved or engraved (3D effect)▄▄▄ (varies by browser)
ridgeOpposite of groove; appears raised▀▀▀ (varies by browser)
insetMakes the border look embedded (inset)— (3D effect)
outsetMakes the border look raised (outset)— (3D effect)

🎯 Usage Examples

1. Solid bottom border

h1 {
border-bottom-style: solid;
border-bottom-width: 3px;
border-bottom-color: #333;
}

Creates a bold, solid line beneath the heading.


2. Dashed underline

p.note {
border-bottom-style: dashed;
border-bottom-width: 2px;
border-bottom-color: orange;
}

Adds a dashed orange line below the paragraph.


3. No bottom border

img {
border-bottom-style: none;
}

Removes any bottom border that might be set by default.


🛠️ Important Notes

  • border-bottom-style alone won’t show a border unless border-bottom-width is set to a value greater than zero.
  • The default style for borders is none.
  • Combine border-bottom-style with border-bottom-width and border-bottom-color for full control.
  • Styles like grooveridgeinset, and outset depend on the browser and may render slightly differently.

✅ Best Practices

  • Use solid for clean, simple lines.
  • Use dashed or dotted for less formal or subtle separation.
  • Avoid overly complex 3D styles unless they fit the design context.
  • Test styles on various devices for consistent appearance.

🔚 Conclusion

The border-bottom-style property is an essential tool for defining how the bottom border line looks on any HTML element. It offers a range of line styles from simple solid lines to decorative 3D effects, allowing you to tailor your design’s detail with precision.