方法:1、用「@keyframes 動畫名稱{100% {transform:rotate(角度)}」建立旋轉動畫;2、用「元素:hover{animation:動畫名稱時間linear infinite}」設置在滑鼠移上元素時觸發動畫。
本教學操作環境:windows7系統、CSS3&&HTML5版、Dell G3電腦。
css實作滑鼠移上去旋轉效果
#旋轉效果可以利用animation屬性和「@keyframes」規則創建動畫實現。
而滑鼠移上元素,觸發旋轉動畫需要使用
:hover
#選擇器。 (:hover 選擇器用於選擇滑鼠指標浮動在上面的元素,並設定樣式。)
#實作程式碼:
<!DOCTYPE html> <html> <head> <style> div { width: 100px; height: 100px; background-color: red; margin: 50px auto; } div:hover { animation: mymove 1s linear infinite; } @keyframes mymove { 100% { transform: rotate(360deg); } } @-webkit-keyframes mymove {/* Safari and Chrome */ 100% { transform: rotate(360deg); } } </style> </head> <body> <div class="box"></div> </body> </html>
(學習影片分享:css影片教學)
以上是css怎麼實現滑鼠移上去旋轉效果的詳細內容。更多資訊請關注PHP中文網其他相關文章!

CSSanimationsarenotinherentlyhardbutrequirepracticeandunderstandingofCSSpropertiesandtimingfunctions.1)Startwithsimpleanimationslikescalingabuttononhoverusingkeyframes.2)Useeasingfunctionslikecubic-bezierfornaturaleffects,suchasabounceanimation.3)For

@keyframesispopularduetoitsversatoryand and powerincreatingsmoothcsssanimations.keytricksinclude:1)definingsmoothtransitionsbetnestates,2)使用AnimatingMultatingMultationMultationProperPertiessimultane,3)使用使用4)使用BombingeNtibalibility,4)使用CombanningWiThjavoFofofofoftofofo

CSSCOUNTERSAREDOMANAGEAUTOMANAMBERINGINWEBDESIGNS.1)他們可以使用forterablesofcontents,ListItems,and customnumbering.2)AdvancedsincludenestednumberingSystems.3)挑戰挑戰InclassINCludeBrowsEccerCerceribaliblesibility andperformiballibility andperformissises.4)創造性

使用滾動陰影,尤其是對於移動設備,是克里斯以前涵蓋的一個微妙的UX。傑夫(Geoff)涵蓋了一種使用動畫限制屬性的新方法。這是另一種方式。

文章討論了CSS FlexBox,這是一種佈局方法,用於有效地對齊和分佈響應設計中的空間。它說明了FlexBox用法,將其與CSS網格進行了比較,並詳細瀏覽了瀏覽器支持。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

Atom編輯器mac版下載
最受歡迎的的開源編輯器

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。

PhpStorm Mac 版本
最新(2018.2.1 )專業的PHP整合開發工具

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。