CSS border-image-outset屬性是一種簡寫屬性,用於指定元素邊框圖像放置在其框外的距離。
注意:border-image-outset對border-image-source指定的圖片生效。
用法:
border-image-outset:value;
屬性值:
值 | 影響 |
---|---|
Length | 將邊框起始尺寸指定為尺寸。 |
Number | 將邊框的大小指定為對應的border-width的倍數。 |
Initial | 將邊框的大小指定為默認大小。 |
Inherit | 從其父元素繼承值。 |
示例程序:
<!DOCTYPE html>
<html>
<head>
<style>
body {
text-align:center;
}
h1 {
color:green;
}
.border1 {
border:10px solid transparent;
padding:15px;
border-image-source:url(
https://media.geeksforgeeks.org/wp-content/uploads/border1-2.png);
border-image-repeat:round;
border-image-width:20px;
border-image-slice:30;
border-image-outset:10px 20px 12px 9px;
}
.border2 {
border:10px solid transparent;
padding:15px;
border-image-source:url(
https://media.geeksforgeeks.org/wp-content/uploads/border1-2.png);
border-image-repeat:round;
border-image-outset:1;
border-image-slice:30;
border-image-width:20px;
}
.border3 {
border:10px solid transparent;
padding:15px;
border-image-source:url(
https://media.geeksforgeeks.org/wp-content/uploads/border1-2.png);
border-image-repeat:round;
border-image-outset:initial;
border-image-width:20px;
}
.border4 {
border:10px solid transparent;
padding:15px;
border-image-source:url(
https://media.geeksforgeeks.org/wp-content/uploads/border1-2.png);
border-image-repeat:round;
border-image-outset:inherit;
border-image-width:20px;
}
div {
margin-top:20px;
}
</style>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>border-image-outset property</h2>
<div class = "border1">Border 1(Length)</div>
<div class = "border2">Border 2(Number)</div>
<div class = "border3">Border 3(Initial)</div>
<div class = "border4">Border 4(Inherit)</div>
</body>
</html>
輸出:
瀏覽器支持:下麵列出了border-image-outset屬性支持的瀏覽器:
- chrome 15.0
- Edge-11.0
- Firefox-15.0
- Opera 15.0
- Safari 6.0
相關用法
- HTML Style borderImageOutset用法及代碼示例
- CSS transition-property用法及代碼示例
- CSS right屬性用法及代碼示例
- CSS nav-right用法及代碼示例
- CSS nav-down用法及代碼示例
- CSS nav-up用法及代碼示例
- CSS all屬性用法及代碼示例
- CSS top屬性用法及代碼示例
- CSS filter屬性用法及代碼示例
- CSS column-gap用法及代碼示例
- HTML DOM id用法及代碼示例
- CSS transform屬性用法及代碼示例
- CSS direction屬性用法及代碼示例
- CSS z-index用法及代碼示例
- CSS tab-size用法及代碼示例
注:本文由純淨天空篩選整理自DannanaManoj大神的英文原創作品 CSS | border-image-outset Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。