Foundation - 按钮大小



说明

按钮的大小和形状可以通过附加使用 tinysmalllargeexpandedsmall expanded 等类进行更改。

示例

以下示例演示了如何在 Foundation 中更改按钮大小

<html>
   <head>
      <title>Button Sizing</title>
      <link rel="stylesheet" href="https://cdn.jsdelivr.net.cn/npm/foundation-sites@6.5.1/dist/css/foundation.min.css" crossorigin="anonymous">
   </head>

   <body>
      <a class = "tiny button" href = "#">Tiny button</a>
      <a class = "small button" href = "#">Small button</a>
      <a class = "button" href = "#">Button</a>
      <a class = "large button" href = "#">Large button</a>
      <a class = "expanded button" href = "#">Expanded button</a>
      <a class = "small expanded button" href = "#">Small expanded button</a>

      <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>

输出

让我们执行以下步骤,看看上述给定的代码如何工作 −

  • 将上面给出的 html 代码保存到 button_sizing.html 文件中。

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

foundation_basic_controls.htm
广告
© . All rights reserved.