CSS border-bottom Property

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

What You’ll Learn

The border-bottom property is a CSS shorthand for styling the bottom border of an element. With one declaration you can set the border width, style, and color on the physical bottom edge only.

01

Bottom Edge

Physical bottom side.

02

Shorthand

Width, style, color.

03

Longhands

Width, style, color split.

04

One Edge

Bottom border only.

05

Dividers

Lists, tabs, sections.

06

vs block-end

Physical vs logical.

Definition and Usage

The border-bottom CSS property is a shorthand that sets the width, style, and color of the bottom border of an element. Unlike logical properties, it always targets the physical bottom edge regardless of writing mode or text direction.

This property is useful for creating visually distinct elements within your web design. Common uses include section dividers, list separators, active tab underlines, and footer rules.

💡
Beginner Tip

border-bottom: 2px solid red; is one of the most common patterns for a simple bottom divider. Pair it with padding-bottom so text does not touch the line.

📝 Syntax

The border-bottom shorthand sets width, style, and color on the bottom edge:

syntax.css
selector {
  border-bottom: <border-width> <border-style> <border-color>;
}

Basic Example

border-bottom.css
div {
  border-bottom: 2px solid red;
}

You can also set the parts individually with longhand properties:

border-bottom-width

Sets thickness on the bottom edge only.

border-bottom-style

Sets line style on the bottom edge only.

border-bottom-color

Sets color on the bottom edge only.

Syntax Rules

  • Values follow the usual border order: width, then style, then color.
  • A visible style such as solid is required for the border to show.
  • Only the bottom edge is affected; other sides keep their existing borders.
  • Related side shorthands include border-top, border-left, and border-right.
  • Use padding-bottom to add space between content and the bottom border.

⚡ Quick Reference

QuestionAnswer
Initial valuemedium none currentColor
Applies toBottom border side only
InheritedNo
AnimatablePartially (color and width in supporting browsers)
Common useSection dividers, paragraph rules, footer borders

Default Value

The default value for border-bottom comes from its longhand parts:

  • border-bottom-widthmedium
  • border-bottom-stylenone
  • border-bottom-colorcurrentColor

Because the default style is none, no border is visible until you set a visible style such as solid.

💎 Property Values

The border-bottom shorthand accepts the same value types as other border shorthands.

ValueExampleMeaning
<border-width>border-bottom: 2px solid black;Thickness using px, em, rem, thin, medium, or thick
<border-style>border-bottom: 2px dashed black;Line style such as solid, dotted, dashed, or double
<border-color>border-bottom: 2px solid #2563eb;Any valid CSS color value or currentColor

Physical Bottom Edge

border-bottom always styles the visual bottom of an element, even when writing mode changes. That makes it predictable for horizontal layouts, but different from logical properties.

Horizontal writing → bottom border stays at bottom Vertical writing → bottom border still on physical bottom

Horizontal writing

Border on the bottom edge

Vertical writing (vertical-rl)

Physical bottom border

border-bottom vs border-block-end

PropertyTargetsBest for
border-bottomPhysical bottom edge alwaysSimple horizontal pages, tabs, lists, and section dividers
border-block-endLogical block-end edgeMultilingual layouts and writing-mode-aware components
border-topPhysical top edge alwaysHeader rules and top accents
borderAll four sides togetherWhen every edge needs the same border

👀 Live Preview

A box with a 3px solid blue bottom border:

This element has a border on the bottom edge.

Uses border-bottom: 3px solid #2563eb; on the physical bottom side.

Examples Gallery

Try border-bottom on divs, list items, dashed dividers, and active tab underlines.

📚 Basic border-bottom

Apply a single bottom border with one shorthand rule.

Example 1 — Solid Red Bottom Border

Add a 2px solid red bottom border to a div element.

border-bottom-basic.html
<style>
  div {
    border-bottom: 2px solid red;
    padding-bottom: 0.75rem;
  }
</style>

<div>
  This is a div element with a bottom border.
</div>
Try It Yourself

How It Works

The shorthand styles only the bottom edge. Width, style, and color are combined in one declaration.

Example 2 — List Item Divider

Use bottom borders to separate stacked list items without affecting other sides.

border-bottom-list.css
.menu-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0;
}
.menu-item:last-child {
  border-bottom: none;
}
Try It Yourself

How It Works

Each item gets a subtle bottom divider. Removing the border on the last item avoids an extra line at the bottom of the list.

🎨 Border Styles

Change the style keyword to create dashed, dotted, or other bottom border effects.

Example 3 — Dashed Bottom Border

Use a dashed style for a softer section separator on the bottom edge.

border-bottom-dashed.css
.note {
  border-bottom: 2px dashed #059669;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
Try It Yourself

How It Works

Only the style keyword changes. The border still targets the bottom edge while using a dashed line pattern.

Example 4 — Active Tab Underline

Use border-bottom to highlight the active item in a horizontal tab menu.

border-bottom-tabs.css
.tab.active {
  border-bottom: 3px solid #2563eb;
  padding-bottom: 0.35rem;
  font-weight: 700;
}
Try It Yourself

How It Works

A thicker bottom border on the active tab creates a clear underline effect without styling the other sides.

🧠 How border-bottom Works

1

You set width, style, and color

Write one shorthand such as border-bottom: 2px solid red;.

CSS rule
2

The browser draws the bottom edge

If style is not none, a border appears only on the physical bottom side.

Bottom edge
3

Other sides stay unchanged

Top, left, and right borders remain as they were unless you set them separately.

Single edge
=

Bottom edge accent

Your element gets a clear divider or underline on the bottom without affecting other sides.

Universal Browser Support

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

Baseline · All browsers

Reliable bottom borders on every platform

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

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

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

Conclusion

The border-bottom property is a versatile tool for adding emphasis to the bottom edge of elements. Whether you are creating a simple underline effect or designing a more complex layout, this property gives you control over the bottom border in a way that complements your overall design.

Experiment with different widths, styles, and colors to see how border-bottom can enhance your web pages with section dividers, list separators, and tab highlights.

💡 Best Practices

✅ Do

  • Use border-bottom for section dividers, list separators, and tab underlines
  • Pair with padding-bottom so content does not touch the border
  • Use 1px solid with a subtle color for clean UI dividers
  • Remove bottom borders on the last item in a stacked list when needed
  • Use longhands when you only need to change one part such as color

❌ Don’t

  • Set color or width without a visible border style
  • Use border-bottom when you need a writing-mode-aware logical edge
  • Mix heavy bottom borders on every element in a dense UI
  • Forget that borders add to element size unless you use box-sizing: border-box
  • Rely on low-contrast border colors that are hard to see

Key Takeaways

Knowledge Unlocked

Five things to remember about border-bottom

Use these points when styling the physical bottom edge.

5
Core concepts
📝02

Shorthand

Width, style, color.

Syntax
⚙️03

Longhands

Split width/style/color.

Control
📋04

Dividers

Lists and tabs.

Use case
🛠05

One Edge Only

Other sides unchanged.

Scope

❓ Frequently Asked Questions

The border-bottom property is a shorthand that sets the width, style, and color of the bottom border of an element. It only affects the physical bottom edge.
The shorthand defaults to medium none currentColor, meaning no visible border until you set a style other than none.
border-bottom always targets the physical bottom edge. border-block-end follows the writing mode and stays on the logical block-end side when text flow changes.
It is shorthand for border-bottom-width, border-bottom-style, and border-bottom-color.
Use it for section dividers, list separators, active tab underlines, card footers, and any design where you only want a border on the bottom edge.

Practice in the Live Editor

Open the HTML editor, try border-bottom, and preview bottom-edge borders 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