基礎 - 按鈕鏤空樣式



說明

使用 .hollow 類為你的按鈕新增一個鏤空外觀。若要建立一個預設樣式,請在你的設定檔案中的 $button-fill 變數。

示例

以下示例演示如何在基礎中使用 hollow 樣式

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

   <body>
      <button class = "hollow button" href = "#">Primary</button>
      <button class = "secondary hollow button" href = "#">Secondary</button>
      <button class = "success hollow button" href = "#">Success</button>
      <button class = "alert hollow button" href = "#">Alert</button>
      <button class = "warning hollow button" href = "#">Warning</button>

      <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_hollow_style.html 檔案。

  • 在瀏覽器中開啟此 HTML 檔案,輸出如下所示。

foundation_basic_controls.htm
廣告
© . All rights reserved.