CKTIS / CSS
border-right — right-side border
The border-right shorthand sets the width, style, and color of the right border. Omitted components return to their initial values rather than preserving earlier settings.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
border-right: <line-width> || <line-style> || <color>;border-right sets border-right-width, border-right-style, and border-right-color together. It targets the physical right edge regardless of text direction. It is not inherited and does not set the other edges.
The || notation means that one or more components may appear in any order. Width accepts a nonnegative length or thin, medium, thick; percentages are not allowed. Styles include solid, dashed, and dotted, and the color may be currentColor.
Omitted components receive their initial values: medium, none, currentColor. Consequently, border-right: blue does not create a visible line: the none style makes the computed width zero. To change only the color without resetting width and style, use border-right-color. Unlike border, this shorthand does not reset border-image.
The example creates a light-gray box with a blue 6px right border. With the default box-sizing: content-box, the border increases the outer width from 160px to 166px.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>border-right</title>
<style>
.box {
width: 160px;
height: 60px;
background: #eeeeee;
border-right: 6px solid #0000ff;
}
</style>
<div class="box"></div>
</html>Result
A light-gray 160px × 60px content box with a solid blue 6px border on its right edge; total border-box size: 166px × 60px.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.