如图:
这个三角形缺口是透明的,请问咋个实现
大家请注意问题的关键,三角形能看见后面的背景
用border修饰实现三角形,想要透明用rgba
div{
width: 0;
height: 0;
border: 10px solid transparent;
border-top-color: rgba(0,0,0,0.4)
}
div::before {
content: "";
display: block;
position: absolute;
bottom: 0;
left: -10px;
width: 20px; /*自己调*/
border: 10px solid transparent;
border-bottom-color: white;
}
div::after {
content: "";
display: block;
position: absolute;
bottom: 0;
right: -10px;
width: 88px; /*自己调*/
border: 10px solid transparent;
border-bottom-color: white;
}
10 回答11.7k 阅读
2 回答3.2k 阅读✓ 已解决
5 回答2.2k 阅读
3 回答1.7k 阅读✓ 已解决
5 回答819 阅读
4 回答2.2k 阅读✓ 已解决
3 回答1.2k 阅读✓ 已解决
我之前的做法是在导航栏上弄
弄多一行小小几px高的div的全是白色背景
被选中的那个背景为一种透明“有缺口白色背景”图片