fieldset——一个不常用的HTML标签

fieldset——一个不常用的HTML标签

fieldset 标签 -- 对表单进行分组

  在form表单中,我们可以对form中的信息进行分组归类,如注册表单的form,我们可以将注册信息分组成
    基本信息(一般为必填)
    详细信息(一般为可选)
  那我们如何更好的来实现呢?我们可考虑在表单form中加入下面两个标签:
    fieldset:对表单进行分组,一个表单可以有多个fieldset。
    legend:说明每组的内容描述。

格式:

  <fieldset>
    <legend>health information</legend>
      height: <input type="text"/>
      weight: <input type="text"/>
  </fieldset>

html:

<HTML>

   <head>
      <meta charset="utf-8" />
      <title></title>
   </head>

   <body>
      <form action="http://www.dreamdu.com/dreamdu.php" method="post" enctype="multipart/form-data" id="dreamduform">
         <fieldset>
            <legend>用户名与密码:</legend>
            <input name="hiddenField" type="hidden" value="hiddenvalue" />
            <label for="username">用户名:</label>
            <input type="text" id="username" value="www.dreamdu.com" />
            <label for="pass">密码:</label>
            <input type="password" id="pass" />
         </fieldset>
         <fieldset>
            <legend>性别:</legend>
            <label for="boy">男</label>
            <input type="radio" value="1" id="sex" />
            <label for="girl">女</label>
            <input type="radio" value="2" id="sex" />
            <label for="sex">保密</label>
            <input type="radio" value="3" id="sex" />
         </fieldset>
         <fieldset>
            <legend>我最喜爱的:</legend>
            <label for="computer">计算机</label>
            <input type="checkbox" value="1" id="fav" />
            <label for="trval">旅游</label>
            <input type="checkbox" value="2" id="fav" />
            <label for="buy">购物</label>
            <input type="checkbox" value="3" id="fav" />
         </fieldset>

      </form>
   </body>

</HTML>

result:

 

html_1:

<fieldset line-height:1.5;color:#E6DB74;">"width:300;height:150;border:1px dashed red" align="center">
   <legend line-height:1.5;color:#E6DB74;">"width:100px;border:1px dashed #ff9966;background-color:#ff0000;text-align:center;font-family:arial;font-weight:bold">
      1234
   </legend>
</fieldset>

result_1:

想了解更多关于fieldset——一个不常用的HTML标签的内容,请扫微信
或微信搜索jiemingpan

本文链接:http://www.soufuzi.com/jianzhan/1437

(0)
上一篇 2023-08-26 00:15:56
下一篇 2023-08-26 00:15:56

相关推荐

  • 设置Git全局忽略

    使用IDE如Intellij Idea时,IDE会在项目目录下创建.idea文件夹。在每个项目.gitignore文件中排除.idea/比较麻烦,设置全局排除会更方便些。 Git全局忽略 在用户主目录下创建文件.gitignore_global,按照.gitignore的格式写排除项 touch ~/.gitignore_global 设置git全局排除选项 git config --global

    2025-04-04 15:09:12
  • 网站内容更新频率如何控制?

    网站内容更新频率如何控制? 1、第一个月建议每天更新5篇内容,内容包含文章跟产品内容。 2、第二个月建议每天更新10篇。 3、第三个月建议每天更新15篇。 4、第四个月基本排名、流量、权重上去了,可以适当的更新,不用每天都更新。 网站内容更新注意事项: 1、文章要跟网站有相关性; 2、文章循序渐进的更新频率;

    2020-08-01 16:17:33