這是一款使用純CSS3製作的單頁切換導覽選單介面設計效果。在該頁面效果中,在頁面的左側垂直排放一組導航按鈕,當點擊導航按鈕時,對應的頁面會從螢幕右側滑動出來,效果非常酷炫。
使用方法
## HTML結構
#此單頁切換導覽功能表介面的HTML結構如下:<p class="ct" id="t1"> <p class="ct" id="t2"> <p class="ct" id="t3"> <p class="ct" id="t4"> <p class="ct" id="t5"> <ul id="menu"> <a href="#t1"><li class="icon fa fa-bolt" id="uno"></li></a> <a href="#t2"><li class="icon fa fa-keyboard-o" id="dos"></li></a> <a href="#t3"><li class="icon fa fa-rocket" id="tres"></li></a> <a href="#t4"><li class="icon fa fa-dribbble" id="cuatro"></li></a> <a href="#t5"><li class="icon fa fa-plus-circle" id="cinco"></li></a> </ul> <p class="page" id="p1"> <section class="icon fa fa-bolt"><span class="title">Bolt</span><span class="hint">...</section> </p> <p class="page" id="p2"> <section class="icon fa fa-keyboard-o"><span class="title">Type</span></section> </p> <p class="page" id="p3"> <section class="icon fa fa-rocket"><span class="title">Rocket</span></section> </p> <p class="page" id="p4"> <section class="icon fa fa-dribbble"> <span class="title">Dribbble</span> <p class="hint"> Im ready to play, <span class="hint line-trough">invite me </span> find me </p> <p class="hint">...</p> </section> </p> <p class="page" id="p5"> <section class="icon fa fa-plus-circle"> <span class="title">More</span> <p class="hint"> ... </p> </section> </p> </p> </p> </p> </p> </p>
CSS樣式
此單頁切換導覽功能表介面使用transform和transition來製作頁面的切換動畫效果。並透過:target偽元素來完成按鈕點擊時的頁面切換。完整的CSS程式碼如下,程式碼中沒有加入瀏覽器廠商的前綴。html, body, .page { width: 100%; height: 100%; margin: 0; padding: 0; transition: all .6s cubic-bezier(.5, .2, .2, 1.1); color: #fff; overflow: hidden; } * { font-family: 'open sans', 'lato', 'helvetica', sans-serif; } .page { position: absolute; } #p1 { left: 0; } #p2, #p3, #p4, #p5 { left: 200%; } #p1 { background: darkslateblue; } #p2 { background: tomato; } #p3 { background: gold; } #p4 { background: deeppink; } #p5 { background: #9b59b6; } #t2:target #p2, #t3:target #p3, #t4:target #p4, #t5:target #p5 { transform: translateX(-190%); transition-delay: .4s !important; } #t2:target #p1, #t3:target #p1, #t4:target #p1, #t5:target #p1{ background: black; } #t2:target #p1 .icon, #t3:target #p1 .icon, #t4:target #p1 .icon, #t5:target #p1 .icon { -webkit-filter: blur(3px); filter: blur(3px); } .icon { color: #fff; font-size: 32px; display: block; } ul .icon:hover { opacity: 0.5; } .page .icon .title { line-height: 2; } #t2:target ul .icon, #t3:target ul .icon, #t4:target ul .icon, #t5:target ul .icon{ transform: scale(.6); transition-delay: .25s; } #t2:target #dos, #t3:target #tres, #t4:target #cuatro, #t4:target #cinco { transform: scale(1.2) !important; } ul { position: fixed; z-index: 1; top: 0; bottombottom: 0; left: 0; margin: auto; height: 280px; width: 10%; padding: 0; text-align: center; } #menu .icon { margin: 30px 0; transition: all .5s ease-out !important; } a { text-decoration: none; } .title, .hint { display: block; } .title { font-size: 38px; } .hint { font-size: 13px; } #p4 .hint { display: inherit !important; } .hint a { color: yellow; transition: all 250ms ease-out; } .hint a:hover { color: #FFF; } .line-trough { text-decoration: line-through; } .page .icon { position: absolute; top: 0; bottombottom: 0; rightright: 10%; left: 0; width: 270px; height: 170px; margin: auto; text-align: center; font-size: 80px; line-height: 1.3; transform: translateX(360%); transition: all .5s cubic-bezier(.25, 1, .5, 1.25); } .page#p1 .icon { height: 220px; } .page#p1 .icon { transform: translateX(10%) !important; } #t2:target .page#p2 .icon, #t3:target .page#p3 .icon, #t4:target .page#p4 .icon, #t5:target .page#p5 .icon { transform: translateX(0) !important; transition-delay: 1s; }
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

Goofonts是由開發人員和設計師丈夫簽名的附帶項目,它們都是版式的忠實擁護者。我們一直在標記Google

學習如何構建GraphQL API可能具有挑戰性。但是您可以學習如何在10分鐘內使用GraphQL API!碰巧的是,我得到了完美的

這裡是Yuanchuan的一些合法CSS騙局。有此CSS屬性偏移路徑。曾幾何時,它被稱為Motion-Path,然後被更名。我


熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
刺客信條陰影:貝殼謎語解決方案
2 週前ByDDD
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

禪工作室 13.0.1
強大的PHP整合開發環境

WebStorm Mac版
好用的JavaScript開發工具

MantisBT
Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。

SublimeText3 Linux新版
SublimeText3 Linux最新版

記事本++7.3.1
好用且免費的程式碼編輯器