Bar sisi asas
Navigasi bar sisi
Yayasan menggunakan <ul class="side-nav">
untuk mencipta bar sisi:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <ul class="side-nav"> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4</a></li> </ul> <div style="padding:20px;"> <h3>侧栏导航</h3> <p> .side-nav 类用于创建侧栏导航,宽度为父元素100%宽度。</p> </div> </body> </html>
Jalankan Instance»
Klik butang "Jalankan Instance" untuk melihat contoh dalam talian
Aktifkan pautan dan garis pembahagi
Pautan yang diklik boleh digunakan pada <li>
.active
Kelas untuk mengenal pasti, gunakan kelas .divider
untuk menambah garis pemisah mendatar:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <ul class="side-nav"> <li class="active"><a class="a" href="#">Link 1</a></li> <li><a class="a" href="#">Link 2</a></li> <li class="divider"></li> <li><a class="a" href="#">Link 3</a></li> <li><a class="a" href="#">Link 4</a></li> </ul> <div style="padding:20px;"> <h3>侧栏导航</h3> <p> .active 类用于设置当期页链接。</p> <p> .divider 类用于设置水平的分割线。</p> </div> </body> </html>
Instance berjalan»
Klik butang "Jalankan Instance" untuk melihat contoh dalam talian
Bar sisi dalam grid
Kita boleh menggunakan mod reka bentuk grid untuk menyediakan bar navigasi sisi . Contohnya adalah seperti berikut :
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div class="row"> <div class="medium-4 columns" style="background-color:#f1f1f1;"> <ul class="side-nav"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Learn HTML</a></li> <li><a href="#">Learn JavaScript</a></li> <li><a href="#">Learn CSS</a></li> <li><a href="#">Learn Foundation</a></li> <li><a href="#">Learn HTML</a></li> <li><a href="#">Learn JavaScript</a></li> <li><a href="#">Learn CSS</a></li> <li><a href="#">Learn Foundation</a></li> </ul> </div> <div class="medium-8 columns"> <h1>侧栏导航</h1> <p>该实例将侧栏导航房子网格设计中,背景为灰色。</p> <p><strong>注意:</strong> 在小屏幕尺寸上,侧栏导航是垂直的,且宽度是延展到整个屏幕(100% width)。</p> <p>重置浏览器查看效果。</p> <p>行为动作可以通过 javascript 或媒体查询来修改它。</p> </div> </div> </body> </html>
Run Instance»
Klik butang "Run Instance" untuk lihat contoh dalam talian