A triangle in CSS that takes the whole width with a fixed height?
问题 I'm trying to make a triangle in CSS that takes the whole width of the parent with a fixed height. I successfully did so with a linear-gradient like this: .triangle { width: 100%; height: 120px; background: linear-gradient(to right bottom, blue 50%, transparent 50%); } <div class="triangle"></div> But the diagonal doesn't look crisp. How could I do the same in CSS without using gradient? 回答1: You can blur the edge a bit .triangle { width: 100%; height: 120px; background: linear-gradient(to