0
我一直在修补下面的代码现在一段时间了,我似乎无法做我需要做的与Chrome和Firefox的支持。我的目标是让图像填充(覆盖)SVG的整个区域。面具SVG与图像
.trap-container {
position: relative;
width: 100%;
height: 200px;
}
.trap-container svg {
position: absolute;
}
.trap-content {
display: inline-block;
position: relative;
top: 10%;
height: 80%;
width: 100%;
bottom: 10%;
color: white;
}
<div class="trap-container">
<svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">
<polygon points="0,0 100,0 100,70 0,100">
</polygon>
</svg>
<div class="trap-content">Legal
</div>
</div>
哪种图片..? –
参数为了这个图像︰https://i.imgur.com/WHnTGPB.jpg?1 – Simon
这将被放置在哪里?作为身体的“背景图像”?您可以修改上面的代码,以将图像与您提供的URL一起包含。 –