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.
Fundamentals
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.
Foundation
📝 Syntax
The border-bottom shorthand sets width, style, and color on the bottom edge:
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.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
medium none currentColor
Applies to
Bottom border side only
Inherited
No
Animatable
Partially (color and width in supporting browsers)
Common use
Section dividers, paragraph rules, footer borders
Defaults
Default Value
The default value for border-bottom comes from its longhand parts:
border-bottom-width — medium
border-bottom-style — none
border-bottom-color — currentColor
Because the default style is none, no border is visible until you set a visible style such as solid.
Reference
💎 Property Values
The border-bottom shorthand accepts the same value types as other border shorthands.
Value
Example
Meaning
<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
Scope
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 bottomVertical writing → bottom border still on physical bottom
Horizontal writing
Border on the bottom edge
Vertical writing (vertical-rl)
Physical bottom border
Compare
border-bottom vs border-block-end
Property
Targets
Best for
border-bottom
Physical bottom edge always
Simple horizontal pages, tabs, lists, and section dividers
border-block-end
Logical block-end edge
Multilingual layouts and writing-mode-aware components
border-top
Physical top edge always
Header rules and top accents
border
All four sides together
When every edge needs the same border
Preview
👀 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.
Hands-On
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>
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.
Compatibility
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 property100% supported
Bottom line: Use border-bottom freely in any project. It works consistently across all browsers.
Wrap Up
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.
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
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about border-bottom
Use these points when styling the physical bottom edge.
5
Core concepts
▦️01
Bottom Edge
Physical bottom side.
Purpose
📝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.