CSS3使用3D環境實現立體魔術方塊效果的實例程式碼分享
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>魔方</title> <style type="text/css"> section{width: 100px;height:100px;border:5px solid red; margin:50px auto;padding:100px;perspective: 800px;} .box {width:100px;height:100px;position:relative; transform-style:preserve-3d; transition:4S; transform-origin:center center -50px; } .box div{width: 100px;height:100px;position:absolute;color:white;font-size:50px;text-align: center;line-height:100px;} .box div:nth-of-type(1){ background: #FF6600;; transform:translateX(-100px) rotateY(-90deg); transform-origin:right; } .box div:nth-of-type(2){ background:red ; transform:translateY(-100px) rotateX(90deg); transform-origin:bottom ; } .box div:nth-of-type(3){ background:darkviolet; transform:translateX(100px) rotateY(90deg); transform-origin:left; } .box div:nth-of-type(4){ background:yellow; transform: translateY(100px) rotateX(-90deg) ; transform-origin:top; } .box div:nth-of-type(5){ background:green; transform:translateZ(-100px) rotateY(180deg); } .box div:nth-of-type(6){ background:blue; } section:hover .box{ transform: rotateX(270deg) rotateY(-270deg) rotateX(-270deg) rotateY(270deg) ; } </style> </head> <body> <section> <div> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> </div> </section> </body> </html>
以上是CSS3使用3D環境實現立體魔術方塊效果的實例代碼分享的詳細內容。更多資訊請關注PHP中文網其他相關文章!
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

文章討論了CSS保證金屬性,特別是“保證金:40px 100px 120px 80px”,其應用程序以及對網頁佈局的影響。

本文討論了CSS邊境屬性,重點是自定義,最佳實踐和響應能力。主要論點:邊境 - 拉迪烏斯(Border-Radius)對響應式設計最有效。

本文討論了CSS中評論的使用,詳細介紹了單線和多行評論語法。它認為註釋可以增強代碼的可讀性,可維護性和協作,但如果無法正確管理,可能會影響網站性能。


熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

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

熱門文章
Windows 11 KB5054979中的新功能以及如何解決更新問題
3 週前ByDDD
如何修復KB5055523無法在Windows 11中安裝?
2 週前ByDDD
Inzoi:如何申請學校和大學
3 週前ByDDD
如何修復KB5055518無法在Windows 10中安裝?
2 週前ByDDD
Roblox:Dead Rails - 如何召喚和擊敗Nikola Tesla
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

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

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

SublimeText3 Linux新版
SublimeText3 Linux最新版

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

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