HTML - DOM樣式物件 borderBottomRightRadius 屬性



HTML DOM 樣式物件 **borderBottomRightRadius** 屬性設定或返回右下角邊框的圓角半徑。

語法

以下是獲取或設定 borderBottomRightRadius 屬性的語法。

設定 borderBottomRightRadius 屬性
object.style.borderBottomRightRadius= "length | percentage | initial | inherit";
獲取 borderBottomRightRadius 屬性
object.style.borderBottomRightRadius;

屬性值

描述
長度 (length) 定義右下角邊框的形狀。其預設值為 0。
百分比 (percentage) 以百分比定義右下角邊框的形狀。
initial 用於將此屬性設定為其預設值。
inherit 用於繼承其父元素的屬性。

返回值

它返回一個字串值,表示元素的 border-bottom-right-radius 屬性。

HTML DOM 樣式物件“borderBottomRightRadius”屬性示例

以下示例說明如何使用長度和百分比值更改右下角的邊框半徑。

設定右下角邊框半徑

以下示例使用畫素值設定右下角的邊框半徑。

<!DOCTYPE html>
<html lang="en">
<head>
    <title>
        HTML DOM Style Object borderBottomRightRadius Property
    </title>
    <style>
        section {
            border: aqua 2px solid;
            height: 400px;
            width: 400px;
        }
    </style>
</head>
<body>
    <p>
        Click to set the radius of Bottom 
        Border of right corner.
    </p>
    <button onclick="fun()">Change</button>
    <section id="border">
        Welcome to Tutorials Point...
    </section>
    <script>
        function fun() {
            document.getElementById("border")
                .style.borderBottomRightRadius = "40px";
        }
    </script>
</body>
</html>

使用百分比設定右下角邊框半徑

以下示例使用百分比設定右下角的邊框半徑。

<!DOCTYPE html>
<html lang="en">
<head>
    <title>
        HTML DOM Style Object borderBottomRightRadius Property
    </title>
    <style>
        section {
            border: aqua 2px solid;
            height: 400px;
            width: 400px;
        }
    </style>
</head>
<body>
    <p>
        Click to set the radius of Bottom Border
        of Right corner.
    </p>
    <button onclick="fun()">Change</button>
    <section id="border">
        Welcome to Tutorials Point...
    </section>
    <script>
        function fun() {
            document.getElementById("border")
                .style.borderBottomRightRadius = "15%";
        }
    </script>
</body>
</html>

支援的瀏覽器

屬性 Chrome Edge Firefox Safari Opera
borderBottomRightRadius 是 4 是 12 是 4 是 5 是 10.5
html_dom_style_object_reference.htm
廣告