分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 教程案例

css transform360度旋转 外边旋转内容不旋转

发布时间:2023-09-06 01:29责任编辑:沈小雨关键词:暂无标签

html:

<div class="wrap_">
???<ul>
???????<li class="one_"><a href="">360旋转</a></li>
???</ul>
</div>

css:

.wrap_ ul li:hover{
???border-style:dashed;
???-webkit-animation: spinAround 9s linear infinite;
???-moz-animation: spinAround 9s linear infinite;
???animation: spinAround 9s linear infinite;
}
.wrap_ ul li:hover a{
???-webkit-animation: spinAround1 9s linear infinite;
???-moz-animation: spinAround1 9s linear infinite;
???animation: spinAround1 9s linear infinite;
}
@-webkit-keyframes spinAround {
???from {
???????-webkit-transform: rotate(0deg)
???}
???to {
???????-webkit-transform: rotate(360deg);
???}
}
@-moz-keyframes spinAround {
???from {
???????-moz-transform: rotate(0deg)
???}
???to {
???????-moz-transform: rotate(360deg);
???}
}
@keyframes spinAround {
???from {
???????transform: rotate(0deg)
???}
???to {
???????transform: rotate(360deg);
???}
}

@-webkit-keyframes spinAround1 {
???from {
???????-webkit-transform: rotate(0deg)
???}
???to {
???????-webkit-transform: rotate(-360deg);
???}
}
@-moz-keyframes spinAround1 {
???from {
???????-moz-transform: rotate(0deg)
???}
???to {
???????-moz-transform: rotate(-360deg);
???}
}
@keyframes spinAround1 {
???from {
???????transform: rotate(0deg)
???}
???to {
???????transform: rotate(-360deg);
???}
}
注:1.外边div正转360,内部元素倒转-360,和外部正传相抵消,不转;
??????2.rotate旋转属性;
??????3.兼容性;

css transform360度旋转 外边旋转内容不旋转

原文地址:http://www.cnblogs.com/HONGYE1994/p/8012267.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved