目录

Fieldset样式(Fieldset Styles)

描述 (Description)

Fieldset用于将相关元素组合在一起。 它可以通过使用.fieldset类在Foundation中实现。

例子 (Example)

以下示例演示了在Foundation中使用fieldset styles

<html>
   <head>
      <title>Form Fieldset Styles</title>
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
   </head>
   <body>
      <fieldset class = "fieldset">
         <legend>Select your favourite sport.</legend>
         <input id = "football" type = "checkbox">
         <label for = "football">Football</label>
         <input id = "cricket" type = "checkbox">
         <label for = "cricket">Cricket</label>
         <input id = "baseball" type = "checkbox">
         <label for = "baseball">Baseball</label>
         <input id = "basketball" type = "checkbox">
         <label for = "basketball">Basketball</label>
      </fieldset>
      <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代码forms_fieldset_styles.html文件。

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

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