【发布时间】:2013-10-26 19:55:03
【问题描述】:
我正在尝试模拟类似于this image 的倾斜路径线。
我这样做的方式是使用两个梯形形状,并将一个与另一个重叠,这与this jsFiddle 中看到的背景相同。
但我意识到我希望形状的其余部分是透明,而不是能够与其他对象重叠。
核心只是一点点 CSS,一个 rightTrapezoid div 内的 outlineMaker div。
.rightTrapezoid {
border-bottom: 100px solid red;
border-left: 0 solid transparent;
border-right: 50px solid transparent;
height: 0;
width: 100px;
}
.outlineMaker {
border-bottom: 80px solid white;
border-left: 0 solid transparent;
border-right: 40px solid transparent;
height: 20px;
width: 80px;
}
有没有一种简洁明了的方法来做到这一点?
【问题讨论】:
标签: css transparency css-shapes