【发布时间】:2015-02-16 15:59:33
【问题描述】:
我有一个覆盖图像滑块的 css 箭头框,但我需要使尾部缩进和透明,以便在其后面看到图像。需要白色部分是透明的。请参阅下面的附件图片和我的 css。谢谢
#flag {
width: 400px; height: 80px; background: #231f20; position: relative;
}
#flag:before {
content: "";
position: absolute;
top: 0;
width: 0;
height: 0;
border-top: 40px solid transparent;
border-bottom: 40px solid transparent;
border-left: 35px solid white;
}
#flag:after {
content: "";
position: absolute;
left: 400px;
bottom: 0;
width: 0;
height: 0;
border-top: 40px solid transparent;
border-bottom: 40px solid transparent;
border-left: 45px solid #231f20;
}
【问题讨论】:
-
您是否尝试将
border-left: 35px solid white;更改为solid transparent?你能发一个小提琴吗? -
您也可以使用 SVG 遮罩:codepen.io/yoksel/full/fsdbu
标签: html css shape css-shapes