目录

甚至宽度组(Even width Group)

描述 (Description)

.expanded类可用于自动将按钮显示为全宽。 根据按钮的数量,它们可以扩展到全宽; 最多可以扩展六个按钮。

例子 (Example)

以下示例演示如何在Foundation中使用even width button group

<html>
   <head>
      <title>Even-width Group</title>
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
   </head>
   <body>
      <div class = "expanded button-group">
         <a class = "button">One</a>
         <a class = "button">Two</a>
         <a class = "button">Three</a>
         <a class = "button">Four</a>
         <a class = "button">Five</a>
         <a class = "button">Six</a>
      </div>
      <div class = "expanded button-group">
         <a class = "button">One</a>
         <a class = "button">Two</a>
         <a class = "button">Three</a>
         <a class = "button">Four</a>
         <a class = "button">Five</a>
         <a class = "button">Six</a>
         <a class = "button">Seven</a>
      </div>
      <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>
      <script>
         $(document).ready(function() {
            $(document).foundation();
         })
      </script>
   </body>
</html>

输出 (Output)

让我们执行以下步骤,看看上面给出的代码是如何工作的 -

  • 保存上面给出的html代码button_group_even_width.html文件。

  • 在浏览器中打开此HTML文件,输出显示如下。

新页面打开
↑回到顶部↑
WIKI教程 @2018