当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


CSS border-block-start-width属性用法及代码示例


CSS中的border-block-start-width属性用于在样式表中的单个位置定义单个逻辑block-start边框属性值。此属性将border-width设置在定义元素边框的顶部。

用法:

border-block-start-width:border-width;

属性值:

  • border-width:此属性保存边框的宽度。

以下示例说明了CSS中的border-block-start-width属性:

范例1:



<!DOCTYPE html> 
<html> 
   
<head> 
    <title>CSS | border-block-start-width Property</title> 
    <style> 
        h1 { 
            color:green; 
        } 
           
        div { 
            background-color:yellow; 
            width:220px; 
            height:40px; 
        } 
        .one { 
            border:5px solid gray; 
            border-block-start-width:8px; 
            background-color:purple; 
        } 
    </style> 
</head> 
   
<body> 
    <center> 
        <h1>Geeksforgeeks</h1> 
        <b>CSS | border-block-start-width Property</b> 
        <br><br> 
        <div class="one">A Computer Science Portal</div> 
    </center> 
</body> 
   
</html>

输出:

范例2:

<!DOCTYPE html> 
<html> 
   
<head> 
    <title>CSS | border-block-start-width Property</title> 
    <style> 
        h1 { 
            color:green; 
        } 
           
        div { 
            background-color:yellow; 
            width:220px; 
            height:40px; 
        } 
        .one { 
            border:5px solid black; 
            border-block-start-width:2px; 
            background-color:purple; 
        } 
    </style> 
</head> 
   
<body> 
    <center> 
        <h1>Geeksforgeeks</h1> 
        <b>CSS | border-block-start-width Property</b> 
        <br><br> 
        <div class="one">A Computer Science Portal</div> 
    </center> 
</body> 
   
</html>

输出:

支持的浏览器:下面列出了border-block-start-width属性支持的浏览器:

  • Firefox
  • Opera
  • Edge



相关用法


注:本文由纯净天空筛选整理自skyridetim大神的英文原创作品 CSS | border-block-start-width Property。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。