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
广告