CSS border-right-color Property

You are Here:

Demo

border-right-color: red;

CSS border-right-color Property

CSS border-right-color property sets the color of an element's right border.

Example

HTML Online Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ border-style: solid; border-right-color: red; } </style> </head> <body> <h1>CSS border-right-color Property</h1> <div> This is div container. </div> </body> </html>

Syntax

Using CSS

element{ border-right-color: red; }

Using Javascript

object.style.borderRightColor="red";

Animatable

Yes, border-right-color property is animatable. CSS Animatable Properties Reference.

Default Value

Default value for CSS border-right-color property is black.

Property Value

The following table provides a list of all values for CSS border-right-color property.

ValueExplanation
colorSpecifies that the border color should be user given color. Check our color combinator
transparentSpecifies that the border color should be transparent.

All in One

In the following example, we will demonstrate all values of CSS border-right-color property.

Example

HTML Online Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ border-style: solid; padding: 10px; } #point{ border-right-color: red; } #point1{ border-right-color: transparent; } </style> </head> <body> <h1>CSS border-right-color Property</h1> <h2>border-right-color: red;</h2> <div id="point"> This is div container. </div> <h2>border-right-color: transparent;</h2> <div id="point1"> This is div container. </div> </body> </html>

Using JavaScript

In the following example, we will demonstrate how to change the CSS border-right-color property of an element using JavaScript.

Example

HTML Online Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ padding: 10px; margin-bottom: 10px; border-style: dashed; } </style> </head> <body> <h1>CSS border-right-color Property</h1> <div> This is div container. </div> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("div")[0]; function myFunction(){ x.style.borderRightColor = "red"; } </script> </body> </html>

Reminder

Hi Developers, we almost covered 98.7% of CSS Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in CSS.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author