CSS border-bottom-width Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Box Model & Borders

What You’ll Learn

The border-bottom-width property sets how thick the bottom border is on an element. It is useful when you want precise control over divider weight on the bottom edge.

01

Bottom Width

Physical bottom edge.

02

thin / medium / thick

Keyword sizes.

03

px / em / rem

Exact length units.

04

medium Default

Browser default size.

05

Needs Style

Pair with style/color.

06

Longhand

Part of border-bottom.

Definition and Usage

The border-bottom-width CSS property allows you to specify the thickness of the bottom border of an element. This property is part of the border longhand family and is used to control the width of the border along the bottom edge.

By adjusting this property, you can enhance visual separation between elements and create more defined layouts with subtle 1px dividers or prominent accent lines.

💡
Beginner Tip

border-bottom-width only sets thickness. Add border-bottom-style: solid; and border-bottom-color: black; so the border is visible, or use border-bottom: 5px solid black; as shorthand.

📝 Syntax

The syntax for border-bottom-width is straightforward. It accepts keyword values or length units.

syntax.css
selector {
  border-bottom-width: <length> | thin | medium | thick;
}

Basic Example

border-bottom-width.css
p {
  border-bottom-width: 5px;
  border-bottom-style: solid;
  border-bottom-color: black;
}

The value can be a keyword such as thin or a length such as 5px, 0.25em, or 1rem.

Syntax Rules

  • The initial value is medium, typically around 3 to 4 pixels.
  • Keywords: thin, medium, and thick.
  • Length values use units like px, em, or rem.
  • Pair with border-bottom-style and border-bottom-color for full control.
  • Use border-bottom shorthand when setting width, style, and color together.

⚡ Quick Reference

QuestionAnswer
Initial valuemedium
Applies toBottom border width only
InheritedNo
AnimatableYes, as a length
Common useSection dividers, footer rules, emphasis lines

Default Value

The default value of border-bottom-width is medium, which typically corresponds to a width of around 3 to 4 pixels depending on the browser’s default settings.

💎 Property Values

The border-bottom-width property accepts keyword values and length units.

ValueDescription
thinA thin border width (typically 1px)
mediumA medium border width (default, typically 3–4px)
thickA thick border width (typically 5–6px)
<length>A specific width using a length unit like px, em, or rem
initialSets the property to its default value
inheritInherits the property value from its parent element
previewthin
previewmedium
previewthick
preview1px
preview4px
preview8px

Physical Bottom Edge

border-bottom-width always sets the thickness of the visual bottom border, even when writing mode changes. For writing-mode-aware layouts, consider border-block-end-width instead.

Horizontal writing

5px bottom border width

Vertical writing (vertical-rl)

Still on physical bottom

border-bottom-width vs border-block-end-width

PropertyTargetsBest for
border-bottom-widthPhysical bottom border thicknessSimple horizontal pages, tabs, lists, and section dividers
border-block-end-widthLogical block-end border thicknessMultilingual and writing-mode-aware layouts
border-bottomWidth, style, and color togetherWhen you want one shorthand for the full bottom border

👀 Live Preview

A box with a 5px bottom border width:

This element has a 5px bottom border width.

Uses border-bottom-width: 5px; with solid style and black color.

Examples Gallery

Try border-bottom-width with pixel lengths, keyword sizes, width comparisons, and bottom-edge overrides.

📚 Basic Bottom Border Widths

Set the bottom border width with style and color longhands so the line is visible.

Example 1 — 5px Bottom Border Width

Set border-bottom-width to 5px on a paragraph element.

border-bottom-width-5px.html
<style>
  p {
    border-bottom-width: 5px;
    border-bottom-style: solid;
    border-bottom-color: black;
    padding-bottom: 0.75rem;
  }
</style>

<p>
  This paragraph has a bottom border width of 5 pixels.
</p>
Try It Yourself

How It Works

5px sets an exact thickness on the bottom edge. Style and color longhands make the border visible.

Example 2 — thin Keyword on a Heading

Use the thin keyword with a dashed blue bottom border on an h2.

border-bottom-width-thin.html
<style>
  h2 {
    border-bottom-width: thin;
    border-bottom-style: dashed;
    border-bottom-color: blue;
    padding-bottom: 0.5rem;
  }
</style>

<h2>This heading has a thin bottom border.</h2>
Try It Yourself

How It Works

thin is a keyword that usually maps to about 1 pixel. Pair it with a visible style and color to create a light heading underline.

📏 Width Comparisons and Overrides

Compare exact pixel widths and override only the bottom edge on a full border.

Example 3 — Compare 1px, 4px, and 8px Widths

See how different pixel values change the weight of a bottom divider.

border-bottom-width-pixels.css
.w-1 {
  border-bottom: 1px solid #64748b;
}
.w-4 {
  border-bottom-width: 4px;
  border-bottom-style: solid;
  border-bottom-color: #2563eb;
}
.w-8 {
  border-bottom: 8px solid #dc2626;
}
Try It Yourself

How It Works

Small differences in width create very different visual weight. Use 1px or 2px for subtle UI lines and larger values for emphasis.

Example 4 — Thick Bottom Accent on a Card

Give all sides a light border, then make only the bottom edge thicker for a tab-style accent.

border-bottom-width-override.css
.tab-card {
  border: 1px solid #cbd5e1;
  border-bottom-width: 4px;
  border-bottom-color: #2563eb;
  padding: 1rem;
  border-radius: 0.5rem;
}
Try It Yourself

How It Works

The border shorthand sets all sides to 1px. border-bottom-width: 4px; then overrides only the bottom thickness for a stronger accent line.

🧠 How border-bottom-width Works

1

You choose a thickness

Set a keyword like thin or a length like 5px.

Width rule
2

You add style and color

Pair the width with border-bottom-style and border-bottom-color.

Border setup
3

The browser draws the bottom edge

Only the physical bottom border uses that thickness. Top, left, and right sides stay unchanged.

Bottom edge
=

Sized bottom divider

Your element gets a clear separator with the thickness you chose on the bottom edge.

Universal Browser Support

The border-bottom-width property is supported in all major browsers, including Chrome, Firefox, Safari, Edge, Opera, and Internet Explorer. It is one of the most reliable CSS border properties.

Baseline · All browsers

Reliable bottom border widths on every platform

Chrome, Firefox, Safari, Edge, and Opera all support border-bottom-width consistently.

100% Universal support
Google Chrome69+ · Desktop & Mobile
Full support
Mozilla Firefox66+ · Desktop & Mobile
Full support
Apple Safari12.1+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera56+ · Modern versions
Full support
border-bottom-width property 100% supported

Bottom line: Use border-bottom-width freely in any project. It works consistently across all browsers.

Conclusion

The border-bottom-width property is a useful tool for controlling the thickness of the bottom border of elements. Whether you want a subtle 1px divider or a prominent accent line, adjusting the border width helps you achieve the desired visual effect.

Experiment with keyword values like thin and thick, or use exact lengths such as 2px and 4px to find the best fit for your design needs.

💡 Best Practices

✅ Do

  • Use 1px or 2px for subtle UI dividers on the bottom edge
  • Pair width with style and color longhands for predictable results
  • Use rem when you want thickness to scale with root font size
  • Use the border-bottom shorthand when setting all three parts
  • Override only border-bottom-width when other sides use the border shorthand

❌ Don’t

  • Set width alone and forget a visible border style
  • Use border-bottom-width when you need a writing-mode-aware logical edge
  • Use very thick borders everywhere in minimal UI designs
  • Mix physical and logical width properties without a clear reason
  • Rely on medium when you need exact pixel control

Key Takeaways

Knowledge Unlocked

Five things to remember about border-bottom-width

Use these points when sizing the physical bottom edge.

5
Core concepts
⚙️02

medium Default

Browser default size.

Default
📏03

thin / thick

Quick keywords.

Values
📝04

px / em / rem

Exact lengths.

Units
🔄05

One Edge Only

Other sides unchanged.

Scope

❓ Frequently Asked Questions

The border-bottom-width property sets the thickness of the bottom border of an element. It only affects the physical bottom edge.
The initial value is medium, which is typically around 3 to 4 pixels depending on the browser.
Width alone does not always show a border. You also need a visible border-bottom-style such as solid and usually a color, or use the border-bottom shorthand.
border-bottom-width always sets the physical bottom edge thickness. border-block-end-width follows the writing mode and stays on the logical block-end side.
Length values like 1px, 2px, and 4px are most common in modern UI. Keywords thin, medium, and thick are useful for quick sizing.

Practice in the Live Editor

Open the HTML editor, try border-bottom-width, and preview bottom border thickness instantly.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful