CSS - border-right-color



Sets the color of an element's right border; default is the color of the element.

Possible Values

  • color − Any valid color value.

Applies to

All the HTML elements.

DOM Syntax

object.style.borderRightColor = "red";
Always declare the border-right-style or the border-style property before the border-right-color property.

Example

Here is the example which shows effect of this property −

  <html>
  <head>
     <style>
        p.example1 {border-style: solid;
           border-right-color: rgb(255, 0, 0);
           }
        p.example2 {border-style: solid;
            border-right-color: rgba(255, 0, 0,0.4);
            }
        p.example3 {border-style: solid;
            border-right-color: hsl(0, 100%, 50%);
            }
        p.example4 {border-style: solid;
            border-right-color: hsla(0, 100%, 50%, 0.3);
            }
        p.example5 {border-style: solid;
            border-right-color: transparent;
            }
     </style>
  </head>
  <body>
        <p class="example1">right border with RGB color value</p>
        <p class="example2">right border with RGBA color value</p>
        <p class="example3">right border with HSL color value</p>
        <p class="example4">right border with HSLA color value</p>
        <p class="example5">right border with transparent color value</p>

  </body>
  </html>
Advertisements