CSS border-right Property

Description

The CSS property border-right is used to define the styling of the right border of an element in a webpage. It allows web developers to specify the border's width, style, and color. For example, you can set the border-right property to create a solid, dashed, or dotted line on the right side of an element, and you can customize its color to match your design preferences. This property is part of a set of border properties that enable fine-grained control over an element's border appearance, helping to enhance the overall layout and visual presentation of web content. Individual properties are: border-right-color, border-right-style, and border-right-width.

Initial value
See individual properties
Applies to
All elements
Inherited
No
Computed value
See individual properties
Animatable
Yes
JavaScript syntax
object.style.borderRight

Interactive Demo

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass. A lone dandelion seed, adrift on the breeze, whispered secrets of faraway fields, of dandelion suns and galaxies spun from fluff. Somewhere, beyond the veil of dusk, a coyote laughed, echoing through the stillness like a forgotten memory.

Syntax

border-right: <line-width> || <line-style> || <color> 

Values

Example

<div class="border">This is an example of the border-right property using a red solid border 3px in width.</div>
.border {
   border: 1px solid blue;
   border-right: 3px solid red;
   margin: 20px;
   padding: 20px;
}

Browser Support

The following table will show you the current browser support for the CSS border-right property.

Desktop
Edge Chrome Firefox Opera Safari
12119.21
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
1814141137

Last updated by CSSPortal on: 31st December 2023