广告应从背景图片的底部滑动,然后固定在其显示位置。从底部到广告展示只是一个滑动效果。
例如,请在此页面上检查广告:-
我想这就是您要寻找的:
.container {
position:relative;
overflow:hidden;
width:300px;
height:200px;
}
.img {
width:100%;
height:100%;
background:blue;
}
.slidemeup{
background:red;
position:absolute;
bottom:-50px;;
height:50px;
width:100%;
left:0;
animation-name:slideup;
animation-delay:0.5s;
animation-duration:0.8s;
animation-fill-mode:forwards;
animation-timing-function:ease-out;
}
@keyframes slideup {
0%{bottom:-50px}
100%{bottom:0;}
}
<div class="container">
<div class="img">
</div>
<div class="slidemeup">
SLIDE ME UP
</div>
</div>
我用了一个div与类img
而不是图像。但无论哪种方式都可以工作
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句