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

相关推荐

  • 关键词布局方法

    1、<title>标签中布局关键词 <title>标签是用来定义网页标题的标签,除了显示在网页源代码中,还会显示在浏览器上方的标题栏中,以及搜索结果的第一行。这就说明一个网页的标题与用户搜索的内容越接近就越有优先展示的机会。所以页面<title>标签中要包含关键词,方便用户捜索。另外,搜索引擎会根据<title>标签中的内容进行索引,在此标签中布局关键词,可以提升关键词与页面的相关性,进而影

    2023-12-10 11:33:24
  • 域名注册服务服务Namecheap.com怎么样

    Namecheap.com是一个实惠和可靠的域名注册服务,让你为你想要的域名找到最好的价格并在线注册。它还提供具有额外好处的批量域名注册选项。他们的一些服务包括域名注册、域名转移、个人域名、Whois服务、DNS、主机和服务器、市场、SSL证书等。它还为企业提供一些应用程序,以完美地创建和营销他们的网站。

    2023-12-02 23:50:53