CSS border-right-width Property

Thuộc tính border-right-width trong CSS đặt độ rộng đường viền bên phải của một phần tử. Nó có thể được xác định bằng các đơn vị như pixel, em hoặc phần trăm. Thuộc tính này giúp kiểm soát độ dày của đường viền bên phải. Nó giúp tăng cường kiểu dáng và bố cục của phần tử.

Cú pháp:

border-right-width: medium|thin|thick|length|initial|inherit; 

Giá trị thuộc tính:

Giá trị Mô tả
medium Giá trị mặc định đặt đường viền bên phải có kích thước trung bình.
thin Đặt đường viền bên phải mỏng.
thick Đặt đường viền bên phải dày.
length Đặt độ dày của đường viền bên phải bằng đơn vị độ dài cụ thể. Ví dụ: px, em, rem.
initial Đặt độ rộng đường viền bên phải về giá trị mặc định của trình duyệt.

. border-right-width:medium

Thuộc tính border-right-width: medium; đặt đường viền bên phải của phần tử có độ dày trung bình mặc định.

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

html
<!DOCTYPE html>
<html>

<head>
    <title>
        CSS border-right-width Property
    </title>
    <style>
        h3 {
            border: solid green;
            border-right-width: medium;
            width: 50%;
        }

        p {
            border-style: dotted;
            border-right-width: medium;
            width: 70%;
        }
    </style>
</head>

<body>
    <center>
        <h1 style="color:green">
            GeeksForGeeks
        </h1>
        <h2>border-right-width:initial;</h2>

        <!-- border-right-width property used here -->
        <h3>GeeksForGeeks</h3>

        <!-- border-right-width property used here -->
        <p>
            It is a computer science portal for geeks.
        </p>
    </center>
</body>

</html>

Đầu ra:

css-border-right-width-property

2. border-right-width:thin

Thuộc tính border-right-width: thin; đặt đường viền bên phải của một phần tử có độ dày mỏng.

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

html
<!DOCTYPE html>
<html>

<head>
    <title>
        CSS border-right-width Property
    </title>
    <style>
        h3 {
            border: solid green;
            border-right-width: thin;
            width: 50%;
        }

        p {
            border-style: dotted;
            border-right-width: thin;
            width: 70%;
        }
    </style>
</head>

<body>
    <center>
        <h1 style="color:green">
            GeeksForGeeks
        </h1>
        <h2>border-right-width:initial;</h2>

        <!-- border-right-width property used here -->
        <h3>GeeksForGeeks</h3>

        <!-- border-right-width property used here -->
        <p>
            It is a computer science portal for geeks.
        </p>
    </center>>
</body>

</html>

Đầu ra:

css-border-right-width-property

. border-right-width:thick

Thuộc tính border-right-width: thick; đặt đường viền bên phải của một phần tử có độ dày lớn.

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

html
<!DOCTYPE html>
<html>

<head>
    <title>
        CSS border-right-width Property
    </title>
    <style>
        h3 {
            border: solid green;
            border-right-width: thick;
            width: 50%;
        }

        p {
            border-style: dotted;
            border-right-width: thick;
            width: 70%;
        }
    </style>
</head>

<body>
    <center>
        <h1 style="color:green">
            GeeksForGeeks
        </h1>
        <h2>border-right-width:initial;</h2>
        <!-- border-right-width property used here -->
        <h3>GeeksForGeeks</h3>
        <!-- border-right-width property used here -->
        <p>
            It is a computer science portal for geeks.
        </p>
    </center>
</body>

</html>

Đầu ra:

css-border-right-width-property

. border-right-width:length

Thuộc tính length trong CSS chỉ định độ rộng của đường viền bằng các đơn vị đo lường cụ thể. Ví dụ: pixel (px), centimet (cm) hoặc các đơn vị chiều dài khác để tùy chỉnh độ rộng của đường viền bên phải.

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

html
<!DOCTYPE html>
<html>

<head>
    <title>
        CSS border-right-width Property
    </title>
    <style>
        h3 {
            border: solid green;
            border-right-width: 10px;
            width: 50%;
        }

        p {
            border-style: dotted;
            border-right-width: 5px;
            width: 70%;
        }
    </style>
</head>

<body>
    <center>
        <h1 style="color:green">
            GeeksForGeeks
        </h1>
        <h2>border-right-width:initial;</h2>
        <!-- border-right-width property used here -->
        <h3>GeeksForGeeks</h3>

        <!-- border-right-width property used here -->
        <p>
            It is a computer science portal for geeks.
        </p>
    </center>
</body>

</html>

Đầu ra:

css-border-right-width-property

. border-right-width:initial

Thuộc tính initial trong CSS đặt một thuộc tính CSS về giá trị mặc định của nó. Cụ thể, nó khởi tạo độ rộng đường viền bên phải về cài đặt mặc định.

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

html
<!DOCTYPE html>
<html>

<head>
    <title>
        CSS border-right-width Property
    </title>
    <style>
        h3 {
            border: solid green;
            border-right-width: initial;
            width: 50%;
        }

        p {
            border-style: dotted;
            border-right-width: initial;
            width: 70%;
        }
    </style>
</head>

<body>
    <center>
        <h1 style="color:green">
            GeeksForGeeks
        </h1>
        <h2>border-right-width:initial;</h2>

        <!-- border-right-width property  used here -->
        <h3>GeeksForGeeks</h3>

        <!-- border-right-width property used here -->
        <p>
            It is a computer science portal for geeks.
        </p>
    </center>
</body>

</html>

Đầu ra:

css-border-right-width-property

Các trình duyệt được hỗ trợ: Dưới đây là danh sách các trình duyệt hỗ trợ thuộc tính border-right-width:


Last Updated : 21/07/2025