Foundation - 按鈕大小



說明

按鈕的大小和形狀可以透過附加使用 tinysmalllargeexpandedsmall expanded 等類進行更改。

示例

以下示例演示瞭如何在 Foundation 中更改按鈕大小

<html>
   <head>
      <title>Button Sizing</title>
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/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.