
慕姐
我找到了适用于任何宽度/高度的解决方案。您可以在linear-gradient背景中使用两个伪元素,例如(fiddle):.btn { position: relative; display: inline-block; width: 100px; height: 50px; text-align: center; color: white; background: gray; line-height: 50px; text-decoration: none;}.btn:before { content: “”; position: absolute; top: 100%; right: 0; width: 50%; height: 10px; background: linear-gradient(to right bottom, gray 50%, transparent 50%)}.btn:after { content: “”; position: absolute; top: 100%; left: 0; width: 50%; height: 10px; background: linear-gradient(to left bottom, gray 50%, transparent 50%)}
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/226093.html原文链接:https://javaforall.net
