Сделайте это по-другому, в зависимости от фона, на котором нужно использовать трюк background-attachment:fixed
body {
padding: 100px;
position: relative;
margin: 0;
background:
url(https://webcdn-compassion-ca.s3.amazonaws.com/_2/img/covid/swoop-90deg-yellow.svg)
top right fixed no-repeat;
}
.container {
max-width: 1280px;
padding: 100px;
background:
url(https://webcdn-compassion-ca.s3.amazonaws.com/_2/img/covid/swoop-90deg-white.svg)
top right fixed no-repeat,
lightblue;
}
.col {
width: 40%;
}
<div class="container">
<div class="col">
<h1>Hello world</h1>
<p>Fusce pellentesque, leo vel posuere volutpat, erat ligula cursus metus, sed blandit dui ligula eu erat. Mauris aliquam nec sem in tincidunt. Quisque ultrices quam eget eros elementum, nec venenatis mauris varius. Sed blandit rhoncus augue id vehicula.
Nulla sapien nulla, maximus in ornare et, condimentum a turpis. In vel tristique ligula. Morbi id massa quis nisi imperdiet semper. Nam convallis ut risus id tristique. Praesent tempus aliquam magna a consequat.</p>
</div>
</div>
Также, как показано ниже, где вам нужно настроить background-position
дочернего элемента в соответствии с родительским
body {
position: relative;
margin: 0;
}
.container {
max-width: 1280px;
padding:80px;
background:
url(https://webcdn-compassion-ca.s3.amazonaws.com/_2/img/covid/swoop-90deg-yellow.svg)
calc(50% + 200px) 0 no-repeat;
}
.col {
padding: 100px;
width:50%;
margin:auto;
background:
url(https://webcdn-compassion-ca.s3.amazonaws.com/_2/img/covid/swoop-90deg-white.svg)
calc(50% + 200px) -80px no-repeat,
lightblue;
}
<div class="container">
<div class="col">
<h1>Hello world</h1>
<p>Fusce pellentesque, leo vel posuere volutpat, erat ligula cursus metus, sed blandit dui ligula eu erat. Mauris aliquam nec sem in tincidunt. Quisque ultrices quam eget eros elementum, nec venenatis mauris varius. Sed blandit rhoncus augue id vehicula.
Nulla sapien nulla, maximus in ornare et, condimentum a turpis. In vel tristique ligula. Morbi id massa quis nisi imperdiet semper. Nam convallis ut risus id tristique. Praesent tempus aliquam magna a consequat.</p>
</div>
</div>
<div class="container">
<div class="col">
<h1>Hello world</h1>
<p>Fusce pellentesque, leo vel posuere volutpat, erat ligula cursus metus, sed blandit dui ligula eu erat. Mauris aliquam nec sem in tincidunt. Quisque ultrices quam eget eros elementum, nec venenatis mauris varius. Sed blandit rhoncus augue id vehicula.
Nulla sapien nulla, maximus in ornare et, condimentum a turpis. In vel tristique ligula. Morbi id massa quis nisi imperdiet semper. Nam convallis ut risus id tristique. Praesent tempus aliquam magna a consequat.</p>
</div>
</div>