【发布时间】:2021-02-04 19:35:09
【问题描述】:
bgpattern,illustrationwoman 类图像应该隐藏在 div 之外,但图像在卡片 div 之外也可见。对我来说,图像只应显示在 div 内部,而不应显示在外部。 Box 类图像应显示在 div 的内侧和外侧。
CSS 即使我尝试overflow: hidden 用于卡片类,但它隐藏了所有向外的图像,但对我来说,不应隐藏框图像我尝试为 bgpatternimg 添加,illustrationwoman 它不起作用。
card {
position: absolute;
background-color: white;
height: 70vh;
width: 130vh;
border-radius: 3%;
position: relative;
margin: auto;
top: 15vh;
}
.bgpatternimg {
overflow: hidden;
position: absolute;
left: -70vh;
top: -30vh;
width: 120vh;
}
.illustratewoman {
overflow: hidden;
position: absolute;
bottom: 10vh;
left: -10vh;
width: 60vh;
height: 50vh;
}
.boximg {
position: absolute;
width: 22vh;
bottom: 4vh;
left: vh;
overflow: visible;
}
<div class="card">
<div class="left">
<div class="bgpattern">
<img class="bgpatternimg" src="images/bg-pattern-desktop.svg" alt="bgpattern">
</div>
<div class="illustratewoman">
<img class="illuswoman" src="images/illustration-woman-online-desktop.svg" alt="illustratewoman">
</div>
<div class="box">
<img class="boximg" src="images/illustration-box-desktop.svg" alt="">
</div>
</div>
【问题讨论】:
-
我给你做了一个sn-p。请把它改成minimal reproducible example