How do I set the position for the pseudo-element so that it doesn't jump to the side at the slightest change in the screen width
HTML
<div class="header-slider">
<div class="header-slider__container">
<img src="/images/watch.png" alt="watch" />
<div class="text">
<h1>
Text
</h1>
<p>
Text
</p>
<a href="#" class="link">Discover</a>
<a href="#" class="btn btn--filled">
<svg width="22" height="19">
<use href="/images/icons/cart.svg#cart" />
</svg>
Add to cart
</a>
</div>
</div>
</div>
SCSS
.header-slider {
position: relative;
margin-top: 90px;
color: $m-black;
&::after {
content: url('/images/lines-1.svg');
z-index: 2;
top: -24%;
right: -14%;
position: absolute;
background-repeat: no-repeat;
pointer-events: none;
}
&__container {
position: relative;
width: 100%;
height: 505px;
background-color: $m-light-pink;
display: flex;
padding: 50px 200px 50px 0;
}
}
1440px pseudo el. looks good
1600px pseudo el. slide away
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…