Home > Web Front-end > HTML Tutorial > HTML
tag groups related elements within a form

HTML
tag groups related elements within a form

WBOY
Release: 2016-08-29 08:36:51
Original
1794 people have browsed it

The

tag packages part of the form content to generate a set of related form fields.

When a group of form elements are placed inside a

tag, the browser will display them in a special way. They may have special borders, 3D effects, or even create a subform to handle these elements.

tag has no required or unique attributes.

The

tag defines the title for the fieldset element.

Differences between HTML 4.01 and HTML 5

HTML5 has the following attributes: disabled, form, name, these attributes are not supported in HTML 4.01.

Properties

Property Value Description
disabled disabled Specifies that fieldsets should be disabled.
form form_id Specifies one or more forms to which the fieldset belongs.
name value Specifies the name of the fieldset.

Example:

<!DOCTYPE HTML>
<html>

<body>

<form>
  <fieldset>
    <legend>健康信息</legend><span style="color: #000000;">
    身高:</span><input type=<span style="color: #800000;">"</span><span style="color: #800000;">text</span><span style="color: #800000;">"</span> /><span style="color: #000000;">
    体重:</span><input type=<span style="color: #800000;">"</span><span style="color: #800000;">text</span><span style="color: #800000;">"</span> />
  </fieldset>
</form>

<p>如果表单周围没有边框,说明您的浏览器太老了。</p>

</body>
</html>
Copy after login

The effect is as follows:

source:php.cn
Previous article:HTML