Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 不断使用css旋转div-仅使用css_Html_Css - Fatal编程技术网

Html 不断使用css旋转div-仅使用css

Html 不断使用css旋转div-仅使用css,html,css,Html,Css,是否可以使用css不断旋转div?我怎么做 例如: div { width:100px; height:100px; border: 1px solid red; } 使用CSS3@keyframes规则 //html <div class="rotating"></div> //css div { width:100px; height:100px; border: 1px solid red; } @-webkit-keyframes

是否可以使用css不断旋转div?我怎么做

例如:

div {
   width:100px;
   height:100px;
   border: 1px solid red;
}

使用CSS3@keyframes规则

//html
 <div class="rotating"></div>



//css

div {
width:100px;
height:100px;
border: 1px solid red;
}

@-webkit-keyframes rotating {
    from{
    -webkit-transform: rotate(0deg);
    }
    to{
    -webkit-transform: rotate(360deg);
    }
}

.rotating {
    -webkit-animation: rotating 2s linear infinite;
}
//html
//css
div{
宽度:100px;
高度:100px;
边框:1px纯红;
}
@-webkit关键帧旋转{
从{
-webkit变换:旋转(0度);
}
到{
-webkit变换:旋转(360度);
}
}
.轮换{
-webkit动画:旋转2s线性无限;
}
这是一个例子