Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. border-right

border-right

Sets multiple right border properties at once. The properties that can be combined are 'border-color', 'border-style', and 'border-width'. The order of values does not matter.

Sample Code

div.test { border-right: dashed;}
div.test1 { border-right: dashed 2px;}
div.test2 { border-right: solid 2px #000;}

Available Values (border-color)

ValueDescription
transparentSets the border color to transparent.
Color code or color nameChanges the border to the specified color. If no value is set for 'border-color', the color specified by the 'color' property is used as the initial value.

Available Values (border-style)

ValueDescription
noneNo border is drawn and the width becomes 0. This is the initial value.
solidThe border is drawn as a single solid line.
dashedThe border is drawn as a dashed line with larger gaps.
dottedThe border is drawn as a dotted line with smaller gaps.
doubleThe border is drawn as two parallel lines.
grooveThe border appears carved into the page. The opposite of 'ridge'.
ridgeThe border appears raised from the page. The opposite of 'groove'.
insetThe border appears embedded into the page. The opposite of 'outset'.
outsetThe border appears to pop out of the page. The opposite of 'inset'.

Available Values (border-width)

ValueDescription
NumberSpecifies the border width using a unit such as 'px'.
thinUses the keyword 'thin'. Most browsers render this as 1px, though it may vary slightly by browser.
mediumUses the keyword 'medium'. Most browsers render this as 3px, though it may vary slightly by browser. This is the initial value when no 'border-width' is specified.
thickUses the keyword 'thick'. Most browsers render this as 5px, though it may vary slightly by browser.

Browser Preview

<div style="border-right: none; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-right: solid 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-right: dashed 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-right: dotted 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-right: double 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-right: groove 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-right: ridge 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-right: inset 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-right: outset 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

Browser Compatibility

Chrome Chrome
1+
Firefox Firefox
1+
Safari Safari
1+
Edge Edge
12+
Supported in all versions
IE IE
11
10
9
8
7
6
Opera Opera
9.2+
8 and below ×
iOS Safari iOS Safari
1+
Android Android Browser
4.4+
3 and below ×
Chrome Android Chrome Android
Latest
Same support as desktop
Firefox Android Firefox Android
Latest
Same support as desktop

※ Version information is based on MDN.

Overview

Sets the 'border-color', 'border-style', and 'border-width' properties for the right border all at once. The order of values does not matter.

When 'border-right' is specified, any right border properties not included in the value are reset to their initial values. In other words, any right border properties set before 'border-right' are all reset.

<div style="border-width: 10px; border-style: dashed; border-right: solid; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

To display any right border, you must always set a value for the 'border-style' property. Since the initial value of 'border-style' is 'none' (width 0), no border is drawn unless you specify a value.

If you find any errors or copyright issues, please .