
- W3.CSS 教程
- W3.CSS - 主頁
- W3.CSS - 概述
- W3.CSS - 環境設定
- W3.CSS - 容器
- W3.CSS - 程式碼著色
- W3.CSS - 卡片
- W3.CSS - 自適應設計
- W3.CSS - 網格
- W3.CSS - 表單
- W3.CSS - 按鈕
- W3.CSS - 工具提示
- W3.CSS - 模態對話方塊
- W3.CSS - 表格
- W3.CSS - 列表
- W3.CSS - 圖片
- W3.CSS - 圖示
- W3.CSS - 顏色
- W3.CSS - 導航
- W3.CSS - 實用程式
- W3.CSS 實用資源
- W3.CSS - 快速指南
- W3.CSS - 實用資源
- W3.CSS - 討論
W3.CSS - 導航
W3.CSS 有多個特殊類,可快速在網站上顯示導航欄或選單。
序號 | 類名稱和描述 |
---|---|
1 | w3-topnav 將列表樣式設為水平選單/導航欄。 |
2 | w3-sidenav 將列表樣式設為垂直選單/導航欄。 |
示例
w3css_navigation.htm
<html> <head> <title>The W3.CSS Navigation</title> <meta name = "viewport" content = "width=device-width, initial-scale = 1"> <link rel = "stylesheet" href = "https://w3schools.tw/lib/w3.css"> <link rel = "stylesheet" href = "http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css"> <link rel = "stylesheet" href = "https://fonts.googleapis.com/icon?family=Material+Icons"> </head> <body class = "w3-container"> <h2>Navigation Demo</h2> <hr/> <h3>Horizontal top navigation bar</h3> <nav class = "w3-topnav w3-red"> <a href="#">Home</a> <a href="#">Overview</a> <a href="#">Environment</a> <a href="#">Containers</a> <a href="#">Grids</a> </nav> <h3>Using font awesome icons</h3> <nav class = "w3-topnav w3-red"> <a href="#"><i class="fa fa-home"></i></a> <a href="#">Overview</a> <a href="#">Environment</a> <a href="#">Containers</a> <a href="#">Grids</a> </nav> <h3>Using material icons</h3> <nav class = "w3-topnav w3-red"> <a href="#"><i class="material-icons">home</i></a> <a href="#">Overview</a> <a href="#">Environment</a> <a href="#">Containers</a> <a href="#">Grids</a> </nav> <h3>Using Side Navigation</h3> <nav class = "w3-sidenav w3-red w3-card-2" style="width:25%"> <a href="#">Home</a> <a href="#">Overview</a> <a href="#">Environment</a> <a href="#">Containers</a> <a href="#">Grids</a> </nav> </body> </html>
結果
驗證結果。
廣告