CSS border-right-style Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The border-right-style property sets the line style of an element’s physical right border. You can also set it through the shorthands border-right or border-style.

The initial value is none, so nothing draws until you pick a visible style such as solid or dashed. Width and color come from border-right-width and border-right-color (color defaults to currentColor). It is not inherited. Unlike border-inline-end-style, it does not flip in RTL layouts.

Baseline · Widely available.

Not deprecated and not experimental. Corner joins between different styles are left undefined by the spec, so mixed styles at corners can look slightly different across browsers.

CSS Syntax

syntax.css
border-right-style: none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset | initial | inherit;

One keyword. Everyday choices are solid, dashed, and dotted.

Property Values

ValueDescriptionTry it
solidA continuous line. Most common visible styleTry it
dashedA series of short dashesTry it
dottedA series of dotsTry it
doubleTwo parallel lines. Needs enough width to show bothTry it
grooveA carved 3D look. Pair with a thicker widthTry it
noneNo right border. Initial valueTry it
initialSets this property to its default value, noneTry it
inheritInherits this property from the parent elementTry it

Also available: hidden, ridge, inset, and outset. On a normal box, hidden looks like none.

How to Use border-right-style

Pick a visible style first, then set width and color if you need them.

  1. Choose the element that should show a line on the physical right side.
  2. Set border-right-style to solid, dashed, dotted, or another keyword.
  3. Add border-right-width when you want a specific thickness. Omit it to use medium.
  4. Optionally set border-right-color, or use the border-right shorthand for all three.
PieceRequired?Role
Style keywordYes (to show a line)Without it, the right border stays none
WidthOptionalDefaults to medium. Use more for double and 3D styles
ColorOptionalDefaults to currentColor
Physical right onlyBy designDoes not move with writing mode or direction

Live Preview

Width and color stay fixed. Only border-right-style changes.

The right edge is 6px so double and groove have room to show.

Box

border-right-style: solid

CSS Examples

Each snippet focuses on border-right-style. Width is only there so the style can show. Use Try It Yourself for a live editor.

Example 1 — Solid Right Border

A continuous line on the physical right edge.

CSS
<style>
  div {
    border-right-width: 4px;
    border-right-style: solid;
    padding: 10px;
  }
</style>

<div>Solid right</div>
Try It Yourself

How It Works

  1. Give it thickness. border-right-width: 4px makes room for a visible edge.
  2. Choose the style. solid draws a continuous line. This is the property that makes the border appear.
  3. Color defaults. With no color set, the line uses currentColor (the text color).
  4. One side only. Top, bottom, and left stay without a border from these rules.

Example 2 — Dashed Right Border

Short dashes along the right edge for a lighter divider.

CSS
<style>
  div {
    border-right-width: 4px;
    border-right-style: dashed;
    border-right-color: #2563eb;
    padding: 10px;
  }
</style>

<div>Dashed right</div>
Try It Yourself

How It Works

  1. Keep a clear width. 4px makes the dashes easy to see.
  2. Swap the style. dashed replaces the solid stroke with short gaps.
  3. Set a color. Blue paints those dashes. Style still decides the pattern.
  4. Same longhand trio. Width, style, and color together match what border-right can set in one line.

Example 3 — Double Right Border

Two parallel lines. Give the border enough width so both show.

CSS
<style>
  div {
    border-right-width: 6px;
    border-right-style: double;
    border-right-color: #0f766e;
    padding: 10px;
  }
</style>

<div>Double right</div>
Try It Yourself

How It Works

  1. Choose double. The browser draws two lines with a gap between them.
  2. Give it room. 6px is wide enough for both lines and the space between.
  3. Set the color. Teal fills both lines on the right edge.
  4. Thin widths struggle. At 1px or 2px, double often looks like a single line.

Edge Cases & Pitfalls

If the right style does not show, one of these is usually why.

none

The default draws nothing

The initial value is none. Width and color alone will not create a line until you set a visible style.

width

double and 3D styles need thickness

double, groove, ridge, inset, and outset look weak or flat at 1px. Use a larger border-right-width.

order

A later shorthand can wipe the style

border-right: 4px #2563eb after your style resets style to none. Put the style in the shorthand, or set border-right-style after it.

RTL

Physical right does not flip in RTL

The style stays on the right even with direction: rtl. Use border-inline-end-style for a logical trailing edge.

table

hidden matters mainly in tables

On a normal box, hidden looks like none. With border-collapse: collapse, hidden can win conflicting table border styles.

Browser Support

border-right-style is a browser CSS property for the box model. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

border-right-style

Supported in all modern browsers and Internet Explorer for the standard line-style keywords.

100% Line styles
Google Chrome All versions
Full support
Mozilla Firefox All versions
Full support
Apple Safari All versions
Full support
Microsoft Edge All versions
Full support
Opera All versions
Full support
Samsung Internet All versions
Full support
Internet Explorer All versions
Full support
border-right-style Widely supported

Bottom line: Safe everywhere for none, solid, dashed, dotted, double, and the 3D keywords. Corner joins between mixed styles are unspecified. It is not a runtime API.

Key Takeaways

  • Role: choose how the physical right border looks — solid, dashed, dotted, and more.
  • Initial value: none. No visible right border until you set a style.
  • Needs width: especially for double and 3D styles. Color defaults to currentColor.
  • Physical: always the right side. Use border-inline-end-style for logical trailing edges.

One line: border-right-style makes the right edge visible — pick a keyword other than none, then tune width and color.

Frequently Asked Questions

It sets the line style of the physical right border only, such as solid, dashed, or dotted. Width and color come from other properties or from a shorthand.
The initial value is none, so no right border appears until you choose a visible style.
none and hidden draw nothing. You also need a non-zero border-right-width. Color defaults to currentColor if you omit it.
Both look the same on a normal box. hidden mainly matters in tables with border-collapse: collapse, where it can win border conflicts.
border-right-style always styles the physical right edge. border-inline-end-style follows writing direction, so it can move to the left in RTL layouts.
It is Baseline and widely available in all modern browsers and Internet Explorer. It is a browser CSS property, not a Node.js feature.

Next: border-right-width

Learn how thick the physical right border should be.

border-right-width tutorial →

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.

8 people found this page helpful