有人可以帮我解决这个问题吗: 我能够添加带有填充图像的 SVG,但纵横比/缩放比例无法正常工作。我尝试了一些解决方案,但都没有奏效。请帮忙。链接如下: https://park-maksimir.hr/testnasve/
答案 0 :(得分:0)
enter code here<style>
.aspectRatioSizer {
display: grid;
}
.aspectRatioSizer > * {
grid-area: 1 / 1 / 2 / 2;
}
</style>
<div class="aspectRatioSizer">
<svg viewBox="0 0 7 2"></svg>
<div>
Content goes here
</div>
</div>
有两件事发生: