The initial value is none, so width or color alone will not draw a border. Pick a visible style such as solid, dashed, or dotted. For width, style, and color together, use the border shorthand.
Baseline · Widely available.
Not deprecated and not experimental. Supported across modern browsers and Internet Explorer. Safe to use as a core box-model property.
Write two keywords.dashed solid is a two-value shorthand.
First value = top and bottom. Those edges become dashed.
Second value = left and right. Those edges become solid.
Need four different sides? Use four values in clockwise order: top, right, bottom, left.
Edge Cases & Pitfalls
If the border disappears or looks wrong, check these first.
none
Default style hides everything
The initial value is none. Setting only border-width or border-color will not draw a line until style is visible.
table
none vs hidden in collapsed tables
With border-collapse: collapse, none has the lowest priority and hidden the highest. Use hidden when you need to suppress a conflicting cell border.
double
double needs enough width
Two lines share the total border-width. A thin width can make double look like a single line. Try 6px or more while learning.
3D
Groove, ridge, inset, and outset depend on color
Those keywords fake a 3D edge from the border color. On a light background with a light color they can look flat. Pair them with a clear color and wider width.
outline
Outline is a different property
outline-style draws outside the border box and does not take layout space. Do not swap it for border-style when you need box-model size.
Compatibility
Browser Support
border-style is a browser CSS property for the box model. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
border-style
Supported in all modern browsers and Internet Explorer (IE 6+). Chrome 4+, Firefox 2+, Safari 3.1+, Edge 12+.
100%Universal support
Google Chrome4+
Full support
Mozilla Firefox2+
Full support
Apple Safari3.1+
Full support
Microsoft Edge12+
Full support
Opera15+ (Chromium)
Full support
Samsung Internet4+
Full support
Internet Explorer6+
Full support
border-styleWidely supported
Bottom line: Safe everywhere for standard line styles. Prefer the shorthand when sides share a style; use side longhands when only one edge must differ. It is not a runtime API.
Remember
Key Takeaways
Role: shorthand for the line style on all four border sides.
Initial value:none. A visible style is required for a border to appear.
1–4 values: all sides, top/bottom + left/right, three-value, or clockwise four-value.
Common picks:solid, dashed, and dotted cover most UI needs.
One line: set a style keyword first — without it, the border stays invisible.
Frequently Asked Questions
It is a shorthand that sets the line style on all four sides of an element's border. One value styles every side; up to four values set top, right, bottom, and left.
The initial style is none, so nothing draws until you set a visible style such as solid or dashed. Width and color alone are not enough.
Both hide the border and force the used width to 0. In collapsed table borders, none has the lowest priority and hidden has the highest, so hidden can suppress conflicting borders.
One value: all sides. Two: top/bottom, then left/right. Three: top, left/right, bottom. Four: top, right, bottom, left (clockwise).
A visible style uses the default medium width and currentColor if you omit width and color. Setting an explicit width and color makes the result clearer while you learn.
It is Baseline Widely available and works in all modern browsers and Internet Explorer. It is a browser CSS property, not a Node.js feature.