亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

如何在一個圓里繞著轉

請問怎么才能讓一個物體在圓里面繞著圓轉?

正在回答

3 回答


<!DOCTYPE html>

<html>

<head>

? <meta charset="UTF-8">

? <title>旋轉的小球</title>

? <style type="text/css">

? ?.box {?

? ? ? margin:100px auto;

? ? ? box-sizing: border-box;?

? ? ? background:red;

? ? ? height: 60px; width: 60px;?

? ? ? border-radius: 50%;?

? ? ? /*box-shadow:0 -20px 0 36px green; */

? ? ? box-shadow:inset 0 -20px 0 26px yellow ;?


? ? ? animation: rotate 1s infinite linear;?

? ? }?

? @keyframes rotate{

?0% { transform: rotate(0deg); }

?100% { transform: rotate(360deg); }?

? ?}?

? </style>

</head>

<body>

? <div></div>


</body>

</html>


0 回復 有任何疑惑可以回復我~
#1

qq_雪夜_2 提問者

非常感謝,我一直都對這些不是很理解
2016-12-21 回復 有任何疑惑可以回復我~

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
<style>
.box{
?width:400px;
?height:400px;
?border:1px solid #000;
?border-radius:100%;
?margin:50px auto;
?position:relative;
}
.path{
?width:300px;
?height:300px;
?border:1px dashed #ccc;
?border-radius:100%;
?position:absolute;
?left:50px;
?top:50px;
}
.ball{
?width:100px;
?height:100px;
?background-color:rgba(255,0,0,.8);
?border-radius:100%;
?position:absolute;
?left:50px;
?top:50px;
?animation:rotate 3s linear infinite;
}
@keyframes rotate{
?from{
??transform-origin:150px 150px;
??transform:rotate(0deg);
?}
?to{
??transform-origin:150px 150px;
??transform:rotate(360deg);
?}?
}
</style>
</head>

<body>
<div class="box">
?<div class="path"></div>
?<div class="ball"></div>
</div>
</body>
</html>


0 回復 有任何疑惑可以回復我~

這上面的代碼是正確的嗎?為什么我輸入進去后沒有任何反應

0 回復 有任何疑惑可以回復我~
#1

qq_BlackDatura_0

在div標簽里加上class="box"就可以了
2017-05-15 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

如何在一個圓里繞著轉

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號