【发布时间】:2020-08-15 14:01:03
【问题描述】:
我有 svg 作为底部,我想在底部有一个按钮。
并做出响应。
我想要实现的是:
是否可以使用 css,我该如何实现?
.container {
position: absolute;
width: 100vw;
height: 500px;
top: 0;
z-index: -1;
}
svg {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
z-index: 0;
}
polygon {
fill: green;
}
<div class="container">
<svg viewBox="0 0 40 100" preserveAspectRatio="none">
<polygon points="0,0 40,0 40,100 0,80" />
</svg>
</div>
【问题讨论】:
-
如果它应该是响应式的,不要使用绝对位置
-
我已经添加了答案。请检查。
标签: html css svg responsive-design