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


CSS border-inline-width用法及代码示例


CSS中的border-inline-width属性用于在样式表的单个位置设置单个逻辑内联border-width属性值。它将边界宽度设置为定义边框元素的顶部和底部。

用法:

border-inline-width:width;

属性值:



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

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

范例1:

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

输出:

范例2:

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

输出:

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

  • Firefox
  • Opera
  • Edge

参考: https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-width




相关用法


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