码迷,mamicode.com
首页 > Web开发 > 详细

css3动画从底部自动上升

时间:2018-04-12 18:01:51      阅读:879      评论:0      收藏:0      [点我收藏+]

标签:port   .com   back   pac   .so   自动   src   http   img   

效果:红色的字和背景从底部慢慢升起
技术分享图片
技术分享图片
技术分享图片
代码
<style>
.father {
width: 300px;
height: 280px;
border: 1px solid #ccc;
margin: 50px auto;
}
.father img{
width: 300px;
height: 200px;
}
.son{
width: 300px;
height:80px;
overflow: hidden;

}
.son1{
animation: sport 1s;
transform: translateY(0px);
width: 300px;
height:80px;
background: #cd0200;
}
@keyframes sport {
0% {transform: translateY(80px);opacity: 1;}
25% {transform: translateY(50px);opacity: 1}
50% {transform: translateY(20px);opacity: 1}
100% {transform: translateY(0px);opacity: 1}
}
h3,p{
color: #000000;
font-size: 13px;
}
h3{
padding: 10px 0 10px 10px;
}
</style>
</head>
<body>
<div class="father">
<img src="image/anli1.png">
<div class="son">
<div class="son1">
<h3>标题标题</h3>
<p>内容内容内容内容内容内容内容内容</p>
</div>
</div>
</div>
</body>

css3动画从底部自动上升

标签:port   .com   back   pac   .so   自动   src   http   img   

原文地址:https://www.cnblogs.com/yuanyuan-1994/p/8809091.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!