CSS |边框块样式属性

原文:https://www . geesforgeks . org/CSS-border-block-style-property/

CSS 中的边框块样式属性用于在样式表中的单个位置设置单个逻辑块边框样式属性值。它设置定义边框元素的顶部和底部的边框样式。

语法:

border-block-style: style;

属性值:

  • 样式:该属性保存边框虚线、边框、虚线等样式。

以下示例说明了 CSS 中的边框块样式属性:

例 1:

<!DOCTYPE html>
<html>

<head>
    <title>CSS | border-block-style Property</title>
    <style>
        h1 {
            color: green;
        }

        div {
            background-color: yellow;
            width: 220px;
            height: 40px;
        }

        .one {
            border: 5px solid cyan;
            border-block-style: dashed;
            background-color: purple;
        }
    </style>
</head>

<body>
    <center>
        <h1>Geeksforgeeks</h1>
        <b>CSS | border-block-style Property</b>
        <br><br>
        <div class="one">A Computer Science Portal</div>
    </center>
</body>

</html>                    

输出:

例 2:

<!DOCTYPE html>
<html>

<head>
    <title>CSS | border-block-style Property</title>
    <style>
        h1 {
            color: green;
        }

        div {
            background-color: yellow;
            width: 220px;
            height: 40px;
        }

        .one {
            border: 5px dotted cyan;
            border-block-style: solid;
            background-color: purple;
        }
    </style>
</head>

<body>
    <center>
        <h1>Geeksforgeeks</h1>
        <b>CSS | border-block-style Property</b>
        <br><br>
        <div class="one">A Computer Science Portal</div>
    </center>
</body>

</html>                    

输出:

支持的浏览器:边框块样式属性支持的浏览器如下:

  • 火狐浏览器
  • 歌剧
  • 边缘