outset边框html,CSS border-image-outset用法及代码示例

CSS border-image-outset属性是一种简写属性,用于指定元素边框图像放置在其框外的距离。

注意:border-image-outset对border-image-source指定的图片生效。

用法:

border-image-outset:value;

属性值:

影响

Length

将边框起始尺寸指定为尺寸。

Number

将边框的大小指定为对应的border-width的倍数。

Initial

将边框的大小指定为默认大小。

Inherit

从其父元素继承值。

示例程序:

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;

}

GeeksforGeeks

border-image-outset property

Border 1(Length)
Border 2(Number)
Border 3(Initial)
Border 4(Inherit)

输出:

c06bb65f320eecd62125100be18a3dd4.png

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

chrome 15.0

Edge-11.0

Firefox-15.0

Opera 15.0

Safari 6.0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值