CSS border-right-color Property

Thuộc tính border-right-color dùng để đặt màu cho viền bên phải của một Element. Bạn cần khai báo border-style hoặc border-left-style trước. Sau đó mới dùng thuộc tính border-right-color.

Cú pháp:

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

Giá trị thuộc tính: 

  • color: Đặt màu cho viền bên phải của Element.
  • Transparent: Chỉ định giá trị trong suốt cho viền bên phải.
  • initial: Đặt thuộc tính về giá trị mặc định của nó.

Ví dụ: Trong ví dụ này, chúng ta sử dụng thuộc tính border-right-color: color.

html
<!DOCTYPE html>
<html>
<head>
    <title>
        CSS | border-right-color Property
    </title>
    <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>
    </center>
</body>
</html>

Đầu ra:

 css-border-right-color-property

Ví dụ: Trong ví dụ này, chúng ta sử dụng thuộc tính border-right-color: transparent.

html
<!DOCTYPE html>
<html>
<head>
    <title>
        CSS | border-right-color Property
    </title>
    <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>
    </center>
</body>
</html>

Đầu ra: 

css-border-right-color-property

Ví dụ: Trong ví dụ này, chúng ta sử dụng thuộc tính border-right-color: initial.

HTML
<!DOCTYPE html>
<html>
<head>
    <title>
        CSS | border-right-color Property
    </title>
    <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>
    </center>
</body>
</html>

Đầu ra:

 css-border-right-color-property

Trình duyệt được hỗ trợ: Các trình duyệt hỗ trợ thuộc tính css border-right-color được liệt kê dưới đây:

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

Last Updated : 21/07/2025