最佳答案
你需要使用clippath
这是示例链接 Codepen
html:
<div class="tag-blue" style="-webkit-clip-path: url(#clip1);clip-path: url(#clip1);">gadgets 3</div>
<svg width="0" height="0">
<defs>
<clipPath id="clip1" clipPathUnits="objectBoundingBox">
<polygon points="0 0, 1 0, .82 1, 0 1">
</polygon>
</clipPath>
</defs>
</svg>
CSS:
.tag-blue{
background-color: red;
height: 300px;
width: 300px;
}
根据需要更改路径
关于html - 如何使用css获得这个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42241501/