Top Bar

优质
小牛编辑
129浏览
2023-12-01

描述 (Description)

工具栏用于在网站中创建导航标题。

例子 (Example)

以下示例演示了在Foundation中使用top bar -

<!doctype html>
   <head>
      <meta charset = "utf-8" />
      <meta http-equiv = "x-ua-compatible" content = "ie = edge" />
      <meta name = "viewport" content = "width = device-width, initial-scale = 1.0" />
      <title>Top Bar</title>
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
   </head>
   <body>
      <h2>Top Bar Example</h2>
      <div class = "top-bar">
         <div class = "top-bar-left">
            <ul class = "dropdown menu" data-dropdown-menu>
               <li class = "menu-text">Foundation</li>
               <li><a href = "#">Home</a></li>
               <li><a href = "#">About Us</a></li>
               <li class = "has-submenu">
                  <a href = "#">Services</a>
                  <ul class = "submenu menu vertical" data-submenu>
                     <li><a href = "#">Service1</a></li>
                     <li><a href = "#">Service2</a></li>
                     <li><a href = "#">Service3</a></li>
                  </ul>
               </li>
               <li><a href = "#">Contact Us</a></li>
            </ul>
         </div>
         <div class = "top-bar-right">
            <ul class = "menu">
               <li><input type = "search" placeholder = "Search Here"></li>
               <li><button type = "button" class = "button">Search</button></li>
            </ul>
         </div>
      </div>
      <script>
         $(document).ready(function() {
            $(document).foundation();
         })
      </script>
   </body>
</html>