gpt4 book ai didi

html - 我怎样才能隐藏我的动画圆波纹效果的溢出?

转载 作者:行者123 更新时间:2023-11-28 00:36:18 26 4
gpt4 key购买 nike

我正在尝试在左下角产生涟漪效应。我希望看到的涟漪效应只显示在英雄区域(100% 的视网膜),而不是溢出到其他部分。

我以为我可以用“溢出:隐藏”来隐藏它,但我似乎错了。

我希望这个对我想要的解释是清楚的。如果我不是,请告诉我。

前端开发新手

.hero-body {
background: #3399ff;
height: 100%;
}

.circle {
position: absolute;
border-radius: 0 50% 0 0;
background: white;
animation: ripple 15s infinite;
box-shadow: 0px 0px 1px 0px #508fb9;
}

.small {
width: 200px;
height: 200px;
left: -100px;
bottom: -100px;
}

.medium {
width: 400px;
height: 400px;
left: -200px;
bottom: -200px;
}

.large {
width: 600px;
height: 600px;
left: -300px;
bottom: -300px;
}

.xlarge {
width: 800px;
height: 800px;
left: -400px;
bottom: -400px;
}

.xxlarge {
width: 1000px;
height: 1000px;
left: -500px;
bottom: -500px;
}

.shade1 {
opacity: 0.2;
}

.shade2 {
opacity: 0.5;
}

.shade3 {
opacity: 0.7;
}

.shade4 {
opacity: 0.8;
}

.shade5 {
opacity: 0.9;
}

@keyframes ripple {
0% {
transform: scale(0.8);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(0.8);
}
}
<div class="row justify-content-center">
<div class='ripple-background'>
<div class='circle xxlarge shade1'></div>
<div class='circle xlarge shade2'></div>
<div class='circle large shade3'></div>
<div class='circle mediun shade4'></div>
<div class='circle small shade5'></div>
</div>
</div>

最佳答案

使用位置:固定;

body {
background: #3399ff;
height: 100%;
width: 100%;
position: fixed;
}

.circle {
position: absolute;
border-radius: 0 50% 0 0;
background: white;
animation: ripple 15s infinite;
box-shadow: 0px 0px 1px 0px #508fb9;
}

.small {
width: 200px;
height: 200px;
left: -100px;
bottom: -100px;
}

.medium {
width: 400px;
height: 400px;
left: -200px;
bottom: -200px;
}

.large {
width: 600px;
height: 600px;
left: -300px;
bottom: -300px;
}

.xlarge {
width: 800px;
height: 800px;
left: -400px;
bottom: -400px;
}

.xxlarge {
width: 1000px;
height: 1000px;
left: -500px;
bottom: -500px;
}

.shade1 {
opacity: 0.2;
}

.shade2 {
opacity: 0.5;
}

.shade3 {
opacity: 0.7;
}

.shade4 {
opacity: 0.8;
}

.shade5 {
opacity: 0.9;
}

@keyframes ripple {
0% {
transform: scale(0.8);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(0.8);
}
}
<div class="row justify-content-center">
<div class='ripple-background'>
<div class='circle xxlarge shade1'></div>
<div class='circle xlarge shade2'></div>
<div class='circle large shade3'></div>
<div class='circle mediun shade4'></div>
<div class='circle small shade5'></div>
</div>
</div>

关于html - 我怎样才能隐藏我的动画圆波纹效果的溢出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56010752/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com