CSS border-right-style Property

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

What You’ll Learn

The border-right-style property defines the line style of the right border on an element. It is useful when you want the right edge styled differently from the other sides.

01

Right Style

Physical right edge.

02

solid

Continuous line.

03

dashed / dotted

Soft dividers.

04

3D Styles

groove, ridge, inset.

05

none Default

No border by default.

06

Longhand

Part of border-right.

Definition and Usage

The border-right-style CSS property specifies the style of the right border of an element. This property allows you to control the appearance of the right edge, enhancing design and visual hierarchy on your web pages.

By choosing different border styles such as solid, dashed, or dotted, you can create a variety of effects for sidebar dividers, callouts, navigation accents, and right-edge highlights.

💡
Beginner Tip

A border only appears when border-right-style is not none. Pair it with border-right-width and border-right-color, or use border-right: 2px solid #000; as shorthand.

📝 Syntax

The syntax for border-right-style is straightforward:

syntax.css
selector {
  border-right-style: <border-style>;
}

Basic Example

border-right-style.css
p {
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #000;
}

The style value refers to the border line type, such as solid, dashed, or dotted.

Syntax Rules

  • The initial value is none, which hides the right border.
  • Common values include solid, dashed, and dotted.
  • 3D-style keywords include groove, ridge, inset, and outset.
  • Pair with width and color longhands, or use the border-right shorthand.
  • Related longhands: border-right-width and border-right-color.

⚡ Quick Reference

QuestionAnswer
Initial valuenone
Applies toRight border style only
InheritedNo
AnimatableNo
Common useQuote bars, right accents, callout dividers

Default Value

The default value of border-right-style is none, meaning no right border is displayed until you choose a visible style.

💎 Property Values

The border-right-style property accepts standard CSS border style keywords.

ValueDescription
noneNo border is displayed
solidA single solid line
dashedA series of dashed lines
dottedA series of dotted lines
doubleTwo solid lines with space between them
grooveA 3D grooved border that looks carved in
ridgeA 3D ridged border that looks raised out
insetA 3D inset border that looks embedded
outsetA 3D outset border that looks raised
hiddenSame as none, but can still affect table layout
previewsolid
previewdotted
previewdashed
previewdouble
previewgroove
previewridge
previewinset
previewoutset

Right Border Style and Text Direction

border-right-style always styles the physical right side. Text direction does not move the border — compare with border-inline-end-style when building RTL layouts.

LTR (direction: ltr)

Dashed right border on the right side

RTL (direction: rtl)

Right border style still on the right side

border-right-style vs border-inline-end-style

PropertyTargetsBest for
border-right-stylePhysical right border styleQuote bars, right accents, and classic LTR layouts
border-inline-end-styleLogical inline-end border style (direction-aware)Trailing edge accents that follow text direction in RTL
border-rightWidth, style, and color on the right sideSetting the full right border in one rule

👀 Live Preview

A box with a solid blue right border style:

This element has a solid right border style.

Uses border-right-style: solid; with width and color longhands.

Examples Gallery

Try border-right-style with solid, dashed, dotted, and double right borders.

📚 Basic Right Border Styles

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

Example 1 — Solid Right Border

Set the right border style to solid with width and color, matching the reference tutorial.

border-right-style-solid.html
<style>
  .box {
    border-right-style: solid;
    border-width: 5px;
    border-color: #3498db;
    padding: 20px;
    width: 200px;
  }
</style>

<div class="box">
  This box has a solid right border.
</div>
Try It Yourself

How It Works

border-right-style: solid draws a continuous line on the physical right edge. Pair it with border-width and border-color so the border is visible.

Example 2 — Different Right Border Styles

Showcase solid, dotted, dashed, and double styles on the right edge.

border-right-style-showcase.html
<style>
  .border-examples div {
    border-right-width: 2px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
  }
  .solid {
    border-right-style: solid;
    border-right-color: #3498db;
  }
  .dotted {
    border-right-style: dotted;
    border-right-color: #e74c3c;
  }
  .dashed {
    border-right-style: dashed;
    border-right-color: #2ecc71;
  }
  .double {
    border-right-style: double;
    border-right-color: #f39c12;
  }
</style>

<div class="border-examples">
  <div class="solid">Solid Border Right</div>
  <div class="dotted">Dotted Border Right</div>
  <div class="dashed">Dashed Border Right</div>
  <div class="double">Double Border Right</div>
</div>
Try It Yourself

How It Works

Each style keyword changes how the right line is drawn. double needs enough width to show two visible lines.

🎨 Practical UI Styles

Use dashed and double styles for dividers and decorative right edges.

Example 3 — Dashed Sidebar Divider

Use a dashed right border style on a sidebar panel or callout for a softer accent.

border-right-style-dashed.css
.callout {
  border-right-style: dashed;
  border-right-width: 3px;
  border-right-color: #7c3aed;
  padding: 0.75rem 1rem;
  background: #faf5ff;
}
Try It Yourself

How It Works

dashed breaks the right border into short segments, which works well for subtle callout accents.

Example 4 — border-right-style in RTL

In RTL text, border-right-style stays on the physical right — unlike border-inline-end-style.

border-right-style-rtl.html
<style>
  .rtl-box {
    direction: rtl;
    border-right-style: solid;
    border-right-width: 4px;
    border-right-color: #059669;
    padding: 0.75rem 1rem;
    background: #ecfdf5;
  }
</style>

<div class="rtl-box">
  حد فيزيكي على اليسار
</div>
Try It Yourself

How It Works

RTL changes text flow but not the physical right edge. For a trailing accent in RTL, use border-inline-end-style instead.

🧠 How border-right-style Works

1

You choose a line style

Set solid, dashed, dotted, or another border style keyword.

Style rule
2

You add width and color

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

Border setup
3

The browser draws the right edge

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

Right edge
=

Styled right accent

Your element gets a clear visual separator on the physical right edge.

Universal Browser Support

The border-right-style 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 right border styles on every platform

Chrome, Firefox, Safari, Edge, and Opera all support border-right-style 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-right-style property 100% supported

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

Conclusion

The border-right-style property provides a variety of options for styling the right border of an element, from simple lines to more complex effects like double and 3D styles.

By experimenting with different style keywords, you can enhance the visual appeal and user experience of your website with sidebar dividers, callouts, and decorative right accents.

💡 Best Practices

✅ Do

  • Use solid for clear sidebar dividers and right-edge accents
  • Try dashed or dotted for softer callout dividers
  • Use border-inline-end-style when the accent must follow text direction in RTL
  • Pair style with width and color longhands for predictable results
  • Use the border-right shorthand when setting all three parts
  • Give double enough width (usually 3px or more) to show two lines

❌ Don’t

  • Leave the value at none and expect a visible border
  • Expect border-right-style to move to the left in RTL layouts
  • Use heavy 3D styles everywhere in modern flat UI
  • Mix physical and logical style properties without a clear reason
  • Forget width when using thin styles like dotted or dashed

Key Takeaways

Knowledge Unlocked

Five things to remember about border-right-style

Use these points when styling the physical right edge.

5
Core concepts
02

none Default

Hidden by default.

Default
📝03

solid / dashed

Most common styles.

Values
⚙️04

Needs Width

Pair with longhands.

Setup
🔄05

One Edge Only

Other sides unchanged.

Scope

❓ Frequently Asked Questions

The border-right-style property sets the line style of the border on the physical right side of an element only.
The initial value is none, which means no right border is displayed until you set a visible style such as solid or dashed.
If the value is none, no border appears. You also need border-right-width greater than zero and usually a color, or use the border-right shorthand.
border-right-style always styles the physical right edge. border-inline-end-style follows writing direction, so it moves to the left in RTL layouts.
solid, dashed, and dotted are the most common for sidebar dividers and right accents. double, groove, ridge, inset, and outset create stronger visual effects.

Practice in the Live Editor

Open the HTML editor, try border-right-style, and preview styled right 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