这次我们要来分享一款很特别的CSS3菜单,菜单的外观是飘带状的,并且每一个菜单项有一个精美的小图标,鼠标滑过菜单项时,菜单项就会向上凸起,像是飘带飘动一样,形成非常酷的3D视觉效果。这款CSS3飘带状3D菜单非常适合作一些活动页面的菜单导航。
在线预览 源码下载
实现的代码。
htmll代码:
<nav> <menu> <li><a href="#"><span>t</span> <span>twitter</span> </a></li> <li id="at"><a href="#"><span>c</span> <span>codepen</span> </a></li> <li><a href="#"><span>d</span> <span>dribbble</span> </a></li> <li><a href="#"><span>g</span> <span>google+</span> </a></li> </menu> <div class="ribbon left"> </div> <div class="ribbon right"> </div> </nav>
css代码:
* { padding: 0; margin: 0; border: 0; } *:after, *:before { display: block; content: ""; position: absolute; } body { background-color: #3d332a; background-image: url('9690bg.jpg'); padding-top: 50px; } nav { width: 476px; margin: auto; position: relative; } menu:after, menu:before { top: 0; width: 60px; height: 76px; background: #eae2d5; } menu:after { clear: both; right: -61px; border-right: 1px solid #857e74; } menu:before { left: -55px; border-left: 1px solid #857e74; } .ribbon { position: absolute; top: 76px; border-style: solid; border-width: 13px; } .ribbon.left { left: -55px; border-color: #857e74 #857e74 transparent transparent; } .ribbon.right { left: 511px; border-color: #857e74 transparent transparent #857e74; } .left:after, .left:before { left: -68px; border-style: solid; z-index: -2; } .left:after { top: -68px; border-width: 58px 0 0 56px; border-color: #eae2d5 transparent transparent transparent; } .left:before { top: -26px; border-width: 0 40px 38px 41px; border-color: transparent transparent #eae2d5 transparent; } .right:after, .right:before { right: -65px; border-style: solid; z-index: -2; } .right:before { top: -25px; border-width: 0 40px 38px 38px; border-color: transparent transparent #eae2d5 transparent; } .right:after { top: -65px; border-width: 58px 56px 0 0; border-color: #eae2d5 transparent transparent transparent; } li { float: left; position: relative; margin-left: 33px; cursor: pointer; background-color: #eae2d5; list-style-type: none; border-left: 2px solid #d7cfc2; border-right: 2px solid #d7cfc2; transition: margin .1s ,padding .1s ,border 1s; } li:first-child { margin-left: 20px; } li:before, li:after { display: block; position: absolute; top: 0; width: 20px; height: 100%; background: inherit; transition: all .1s; } li:before { right: 100%; } li:after { left: 100%; } li:hover { margin-top: -9px; box-shadow: 0 4px 10px 0px #000; transition: margin .2s ,padding .2s; } li:hover:before, li:hover:after { height: 86%; background: #d7cfc2; transition: all .2s; } li:hover:before { transform: rotate(-30deg) skew(-30deg) translate(1.5px,9px); } li:hover:after { transform: rotate(30deg) skew(30deg) translate(-1.5px,9px); } a { display: block; padding: 10px 15px; text-decoration: none; text-align: center; } a span { text-shadow: 1px 1px 1px #FFF; color: #857e74; transition: all .2s; } a span:first-child { font-family: icon; font-size: 33px; display: block; } a span:last-child { text-transform: capitalize; font-family: 'Georgia'; font-size: 11px; letter-spacing: 1px; font-style: italic; color: #6488ba; } li:hover span { transition: all .2s; } li:hover a span:first-child { color: #6488ba; text-shadow: 1px 1px 1px #FFF , 0 0 1px #6488ba; } li:hover a span:last-child { color: #857e74; } @font-face { font-family: icon; src: url('http://bennettfeely.com/fonts/icons.woff'); }
via:http://www.w2bc.com/Article/27670

HTML的作用是通過標籤和屬性定義網頁的結構和內容。 1.HTML通過到、等標籤組織內容,使其易於閱讀和理解。 2.使用語義化標籤如、等增強可訪問性和SEO。 3.優化HTML代碼可以提高網頁加載速度和用戶體驗。

htmlisaspecifictypefodyfocusedonstructuringwebcontent,而“代碼” badlyLyCludEslanguagesLikeLikejavascriptandPytyPythonForFunctionality.1)htmldefineswebpagertuctureduseTags.2)“代碼”代碼“ code” code code code codeSpassSesseseseseseseseAwiderRangeLangeLangeforLageforLogageforLogicIctInterract

HTML、CSS和JavaScript是Web開發的三大支柱。 1.HTML定義網頁結構,使用標籤如、等。 2.CSS控製網頁樣式,使用選擇器和屬性如color、font-size等。 3.JavaScript實現動態效果和交互,通過事件監聽和DOM操作。

HTML定義網頁結構,CSS負責樣式和佈局,JavaScript賦予動態交互。三者在網頁開發中各司其職,共同構建豐富多彩的網站。

HTML適合初學者學習,因為它簡單易學且能快速看到成果。 1)HTML的學習曲線平緩,易於上手。 2)只需掌握基本標籤即可開始創建網頁。 3)靈活性高,可與CSS和JavaScript結合使用。 4)豐富的學習資源和現代工具支持學習過程。

AnexampleOfAstartingTaginHtmlis,beginSaparagraph.startingTagSareEssentialInhtmlastheyInitiateEllements,defiteTheeTheErtypes,andarecrucialforsstructuringwebpages wepages webpages andConstructingthedom。

如何設計菜單中的虛線分割效果?在設計菜單時,菜名和價格的左右對齊通常不難實現,但中間的虛線或點如何...

網頁代碼編輯器中的HTML元素分析許多在線代碼編輯器允許用戶輸入HTML、CSS和JavaScript代碼。最近,有人提出了一...


熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

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

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

SublimeText3漢化版
中文版,非常好用

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

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