html形状变透明,html5 – 在CSS3中创建图像上方的透明箭头

在CSS3中绘制透明/倒三角形

您可以使用CSS3 triangle technic,并通过组合:before和:after伪对象来制作倒置形状,每个对象绘制三角形的一部分.

你可以这样做:

.image {

position:relative;

height:200px;

width:340px;

background:orange;

}

.image:before,.image:after {

content:'';

position:absolute;

width:0;

border-left:20px solid white;

left:0;

}

.image:before {

top:0;

height:20px;

border-bottom:16px solid transparent;

}

.image:after {

top:36px;

bottom:0;

border-top:16px solid transparent;

}

这是一个说明性的jsfiddle

我只是用一个平面橙色背景作为例子……但是你可以把它改成图像,你希望得到你想要的东西=)

编辑:然后更多的最终结果可能是像this

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值