CSS | border-right-color Property

The border-right-color Property is used to set the color of the right-border in an Element. It is mandatory to declare the border-style or the border-left-style property before the border-right-color property.

Syntax:

border-right-color: color|transparent|initial|inherit; 

Property Values

  • color:It sets the color of the Element’s right-border.

    Syntax:

    border-right-color: color;

    Example:

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    <!DOCTYPE html>
    <html>
      
    <head>
        <style>
            h1 {
                color: green;
            }
              
            h3 {
                border: 2px solid green;
                border-right-color: red;
                width: 50%;
            }
        </style>
    </head>
      
    <body>
        <center>
      
            <h1>GeeksForGeeks</h1>
            <h2>border-right-color:color;</h2>
            <h3>GeeksForGeeks</h3>
            
            <p style="border-style:dotted;
                      border-right-color:coral;
                      width:70%;">
                It is a computer science portal for geeks.</p>
      
    </body>
      
    </html>

    chevron_right

    
    

    Output:

  • Transparent:It specify the transparent value of right-border.

    Syntax:

    border-right-color:transparent;

    Example:

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    <!DOCTYPE html>
    <html>
      
    <head>
        <style>
            h1 {
                color: green;
            }
              
            h3 {
                border: 2px solid green;
                border-right-color: transparent;
                width: 50%;
            }
        </style>
    </head>
      
    <body>
        <center>
      
            <h1>GeeksForGeeks</h1>
            <h2>border-right-color:transparent;</h2>
            <h3>GeeksForGeeks</h3>
            <p style="border-style:dotted;
                      border-right-color:transparent;
                      width:70%;">
              It is a computer science portal for geeks.</p>
      
    </body>
      
    </html>

    chevron_right

    
    

    Output:

  • initial:It sets the Property to its default value.
  • Syntax:

    border-right-color:initial;

    Example:

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    <!DOCTYPE html>
    <html>
      
    <head>
        <style>
            h1 {
                color: green;
            }
              
            h3 {
                border: 2px solid green;
                border-right-color: initial;
                width: 50%;
            }
        </style>
    </head>
      
    <body>
        <center>
      
            <h1>GeeksForGeeks</h1>
            <h2>border-right-color:initial;</h2>
            <h3>GeeksForGeeks</h3>
            
            <p style="border-style:dotted;
                      border-right-color:
                      initial;width:70%;">
              It is a computer science portal for geeks.</p>
      
    </body>
      
    </html>

    chevron_right

    
    

    Output:

Supported Browsers: The browser supported by css border-right-color property are listed below:

  • Apple Safari 1.0
  • Google Chrome 1.0
  • Firefox 1.0
  • Opera 3.5
  • Internet Explorer 4.0


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.