我有一个使用以下模式的登录页面:
<main>
<section>Section A</section>
<section>Section B</section>
<section>Section C</section>
<section>Section D</section>
</main>
这是一个长页面,您可以滚动并包含一些动画。我的问题如下:我有一个SVG背景图像分布在B部分和C部分中,需要缩放到一定百分比,并且也要位于某个位置。
到目前为止,我的方法是使用以下代码在<main>
上设置背景图片:
main {
background-image: url('/path/to/image.svg');
background-position: 40% 76%;
background-size: auto;
background-repeat: no-repeat;
background-attachment: scroll;
background-origin: border-box;
background-clip: border-box;
background-color: #ffffff;
}
但是它有两个主要问题:
<main>
的开头开始放置背景图片。