猿问
回到首页
个人中心
反馈问题
注册登录
下载APP
首页
课程
实战
体系课
手记
专栏
慕课教程
CSS3 由小变大的过渡动画
一个DIV,由小变大,然后加透视
怎么实现啊。
单纯的使用scale好像不怎么明显啊。如果加上透视,效果更逼真啊。
神不在的星期二
浏览 8308
回答 2
2回答
呼啦一阵风
div{ width:100px; height:100px; background:red; transition:1s ease; } div:hover{ transform:scale(2); opacity:0; }
0
0
0
慕的地10843
用动画啊,`<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>动画</title> <style> .div{ width: 100px; height: 100px; position: absolute; background: #C94E00; opacity: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); animation: change 5s; -moz-animation: change 5s; -webkit-animation: change 5s; -o-animation: change 5s; } @keyframes change{ from {width: 100px;height: 100px;opacity: 1;} to {width: 500px;height: 500px;opacity: 0;} } </style></head><body> <div class="div"></div></body></html>`
0
0
0
打开App,查看更多内容
随时随地看视频
慕课网APP
相关分类
CSS3
继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续