溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

怎么用html和CSS制作愛心特效

發布時間:2022-02-28 10:34:53 來源:億速云 閱讀:310 作者:小新 欄目:web開發

這篇文章主要介紹怎么用html和CSS制作愛心特效,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!

  HTML部分:

  用三個div分別表示左邊圓、右邊圓和正方形

  <divclass="box">

  <divclass="round1"></div>

  <divclass="round2"></div>

  <divclass="bottom"></div>

  </div>

  CSS部分:

  用border-radius:50%將其設置為圓形,用transform:rotate(45deg)將正方形旋轉45度,將它和圓組合成心形

  .box{

  width:180px;

  height:160px;

  margin:100pxauto;

  animation:size1sinfinite;

  animation-direction:alternate;

  transition:1sall;

  border:1pxsolidblack;

  }

  .round1{

  width:100px;

  height:100px;

  border-radius:50%;

  background-color:hotpink;

  left:0;

  top:0;

  position:absolute;

  }

  .round2{

  width:100px;

  height:100px;

  border-radius:50%;

  background-color:hotpink;

  position:absolute;

  right:0;

  top:0;

  }

  .bottom{

  width:100px;

  height:100px;

  background-color:hotpink;

  position:absolute;

  top:40px;

  left:40px;

  transform:rotate(45deg);

  }

  @keyframessize{

  0%{

  transform:scale(0.6);

  }

  100%{

  transform:scale(1);

  }

  }

以上是“怎么用html和CSS制作愛心特效”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注億速云行業資訊頻道!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女