事實上,我想爲教育目的製造太陽能系統!所以一個大的黃色圓圈應該在中間,其他人應該旋轉!但我沒有任何想法!只是幫助棘手的事情,我會發現其他的東西!我發現下面的代碼,但它只是繞着他自己旋轉!繞css3旋轉中心
div {
margin: 20px;
width: 100px;
height: 100px;
background: #f00;
-webkit-animation-name: spin;
-webkit-animation-duration: 4000ms;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: spin;
-moz-animation-duration: 4000ms;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
-ms-animation-name: spin;
-ms-animation-duration: 4000ms;
-ms-animation-iteration-count: infinite;
-ms-animation-timing-function: linear;
animation-name: spin;
animation-duration: 4000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@-ms-keyframes spin {
from { -ms-transform: rotate(0deg); }
to { -ms-transform: rotate(360deg); }
}
@-moz-keyframes spin {
from { -moz-transform: rotate(0deg); }
to { -moz-transform: rotate(360deg); }
}
@-webkit-keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
現場演示:http://jsfiddle.net/hamidrezabstn/bLqak/
你不是說_Solar System_? :) – Joum
是的,我會做對吧 – hamidrezabstn
也許['transform-origin'](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin)可以幫助你。 – Teemu