[英]Rotate an element around another element - css
我正在使用 CSS,並且想要做一個對象在橢圓中圍繞另一個對象移動的效果。 我沒有使用畫布,這是我的 html:
<div>/*Content intended for ellipse movement*/</div>
<div>/*Element to ellipse around*/</div>
我此時沒有任何 css 我該怎么做? 謝謝你的幫助!
你想做這樣的事情嗎?
body { padding: 50px; } div { position: absolute; width: 100px; height: 100px; background: #9f9; } .high { background-color: #99f; z-index: 1; -webkit-animation: spin 4s linear infinite; -moz-animation: spin 4s linear infinite; animation: spin 4s linear infinite; } @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
<div class="low"></div> <div class="high"></div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.