目录

Sizing Classes

描述 (Description)

您可以使用.tiny.small.large类来更改开关的大小。

例子 (Example)

以下示例演示如何更改Foundation中size of switch

<html>
   <head>
      <title>Sizing Classes</title>
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
   </head>
   <body>
      <div class = "switch tiny">
         <input class = "switch-input" id = "tinySwitch" type = "checkbox" name = "demoSwitch">
         <label class = "switch-paddle" for = "tinySwitch">
            <span class = "show-for-sr">Tiny Switch</span>
         </label>
      </div>
      <div class = "switch small">
         <input class = "switch-input" id = "smallSwitch" type = "checkbox" name = "demoSwitch">
         <label class = "switch-paddle" for = "smallSwitch">
            <span class = "show-for-sr">Small Switch</span>
         </label>
      </div>
      <div class = "switch large">
         <input class = "switch-input" id = "largeSwitch" type = "checkbox" name = "demoSwitch">
         <label class = "switch-paddle" for = "largeSwitch">
            <span class = "show-for-sr">Large Switch</span>
         </label>
      </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代码radio_switch_sizing_classes.html文件。

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

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