HTML - DOM Style 物件 borderBottomLeftRadius 屬性



HTML DOM Style 物件**borderBottomLeftRadius**屬性設定或返回左下角邊框的圓角半徑。

語法

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

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

屬性值

描述
長度 它定義了左下角邊框的形狀。其預設值為 0。
百分比 它以百分比的形式定義了左下角邊框的形狀。
初始值 用於將此屬性設定為其預設值。
繼承 用於繼承其父元素的屬性。

返回值

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

HTML DOM Style 物件“borderBottomLeftRadius”屬性示例

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

設定左下角邊框半徑

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

<!DOCTYPE html>
<html lang="en">
<head>
    <title>
        HTML DOM Style Object borderBottomLeftRadius 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 left corner.
    </p>
    <button onclick="fun()">
        Change
    </button>
    <section id="border">
        Welcome to Tutorials Point...
    </section>
    <script>
        function fun() {
            document.getElementById("border")
                .style.borderBottomLeftRadius = "40px";
        }
    </script>
</body>
</html>

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

以下示例使用畫素百分比設定左下角邊框半徑。

<!DOCTYPE html>
<html lang="en">
<head>
    <title>
        HTML DOM Style Object borderBottomLeftRadius 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 left corner.
    </p>
    <button onclick="fun()">
        Change
    </button>
    <section id="border">
        Welcome to Tutorials Point...
    </section>
    <script>
        function fun() {
            document.getElementById("border")
                .style.borderBottomLeftRadius = "15%";
        }
    </script>
</body>
</html>

支援的瀏覽器

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