HTML5、CSS3实现旋转特效
2017-09-26 16:19
633 查看
利用CSS3的transiton属性,进行控件的旋转,并通过设置旋转时间,实现特效。
效果连接:http://runjs.cn/detail/vkmy8obr
实例代码:直接复制进html执行即可 无需引入其他文件
效果连接:http://runjs.cn/detail/vkmy8obr
实例代码:直接复制进html执行即可 无需引入其他文件
<style> .dh { width: 100px; height: 100px; position: relative; } .dh:before, .dh:after { content: ""; width: 100px; height: 16px; border-radius: 8px; background-color: #000; position: absolute; transition: all 0.15s ease-in-out; /*设置旋转持续时间*/ -webkit-transition: all 0.15s ease-in-out;/*兼容性处理等同于上代码*/ } .dh:before { top: 0; box-shadow: 0 42px #000; } .dh:after { bottom: 0; } .dh:hover:before { top: 42px; box-shadow: none; transform: rotate(225deg);/*顺时针旋转225度*/ -webkit-transition: rotate(225deg);/*兼容性处理等同于上代码*/ } .dh:hover:after { bottom: 42px; transform: rotate(135deg);/*顺时针旋转135度*/ -webkit-transition: rotate(135deg);/*兼容性处理等同于上代码*/ } </style> <div class="dh"> </div>
相关文章推荐
- [HTML5-SVG]使用raphaeljs:代替css3实现qq空间关闭按钮旋转特效
- 【微信支付】分享一个失败的案例 跨域405(Method Not Allowed)问题 关于IM的一些思考与实践 基于WebSocketSharp 的IM 简单实现 【css3】旋转倒计时 【Html5】-- 塔台管制 H5情景意识 --飞机 谈谈转行
- html5和css3实现的3D滚动特效
- 利用CSS3实现图片旋转放大特效
- css3实例教程 一款纯css3实现的发光屏幕旋转特效
- css3-rotate实现超炫环形旋转特效
- css3实现的发光屏幕旋转特效
- js+css3实现立体式图片旋转特效
- html5和css3实现的3D滚动特效
- 一款利用html5和css3实现的3D滚动特效的教程
- css3实现3d旋转动画特效
- css3-rotate实现超炫环形旋转特效
- html5和css3实现的3D滚动特效
- 一款纯css3实现的发光屏幕旋转特效
- 一款纯css3实现的发光屏幕旋转特效
- 30款css3实现的鼠标经过图片显示描述特效
- CSS3 transform实现图片旋转木马3D浏览效果
- HTML5 CSS3 诱人的实例 : 网页加载进度条的实现,下载进度条等
- 手机移动端实现 jquery和HTML5 Canvas的幸运大奖盘特效
- 纯CSS3实现一个旋转的3D立方体盒子