當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


CSS border-inline-style用法及代碼示例

border-inline-style屬性是CSS中的內置屬性,用於在樣式表的單個位置設置單個邏輯塊inline-border-style屬性值。它將內聯border-style設置為定義邊框元素的頂部(左側)和底部(右側)。

用法:

border-inline-style:style;

屬性值:



  • style:此屬性保留虛線,邊框,點線等邊框的樣式。

下麵的示例說明CSS中的border-inline-style屬性:示例1:

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

輸出:

範例2:

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

輸出:

參考: https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-style#:~:text=The%20border%2Dinline%2Dstyle%20CSS,%2C%20directionality%2C%20and%20text%20orientation.

支持的瀏覽器:下麵列出了border-inline-style屬性支持的瀏覽器:

  • Firefox
  • Opera
  • Edge



相關用法


注:本文由純淨天空篩選整理自skyridetim大神的英文原創作品 CSS | border-inline-style Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。