我在CSS中有这个三角形:
.triangle {
width: 0;
height: 0;
border-style: solid;
border-width: 200px 200px 0 0;
border-color: #007bff transparent transparent transparent;
}
<div class="triangle"></div>
如何在斜边线上应用1px阴影?
由于box-shadow
不起作用,因此必须在三角形上应用阴影滤镜:
.triangle {
width: 0;
height: 0;
border-style: solid;
border-width: 200px 200px 0 0;
border-color: #007bff transparent transparent transparent;
-webkit-filter: drop-shadow(1px 1px 1px rgba(0,0,0,.5));
filter: drop-shadow(1px 1px 1px rgba(0,0,0,.5));
}
<div class="triangle"></div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句