Home  >  Article  >  Web Front-end  >  Do you know the specific usage of html tag legend? Detailed explanation of the attributes and usage of the legend tag

Do you know the specific usage of html tag legend? Detailed explanation of the attributes and usage of the legend tag

寻∝梦
寻∝梦Original
2018-08-17 13:41:2013631browse

Do you know the specific usage of

html tag legend? Detailed explanation of the attributes and usage of the legend tag. This article describes the definition and use cases of the html legend tag, as well as the description of the html legend tag attributes.

html legendDefinition and usage examples of tag:

legend element defines the title for fieldset element

The case is as follows:

<!DOCTYPE HTML>
<html>
<body>
<form>
<fieldset>
<legend>健康信息</legend>
身高:<input type="text" />
体重:<input type="text" />
</fieldset>
</form>
<p>如果表单周围没有边框,说明您的浏览器太老了。</p>
</body>
</html>

html legendThe specific usage of tags:

fieldset and legend are actually in the web page The controls and labels used, fieldset is a control in the web page, which is equivalent to the group box, equivalent to the tab in the winform program, and legend is a label, used in conjunction with the fieldset, used to set a title for the fieldset Word.

This tag appears in pairs, starting with

and ending with
A form can have multiple
, each pair of
is a group, each The content description of the group can be described using

HTML element legend field title:

Inserts a caption into the box drawn by the fieldSet object.

Insert a title into the box drawn by the fieldSet object.

The legend element must be located in the first element within the fieldset. Available in HTML and script in Internet Explorer 4.0 and above.

The legend element is a block element. And the tag needs to be closed, that is, it must appear in pairs: .

HTML Tag instance

Related elements in the combined form:

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

html Optional attributes of the legend tag:

DTD Indicates the DTD in which this attribute is allowed. S=Strict, T=Transitional, F=Frameset.

Do you know the specific usage of html tag legend? Detailed explanation of the attributes and usage of the legend tag

Browser support:

All browsers support tag.

Differences between HTML and XHTML:

In HTML 4.01, the align attribute is deprecated.

In XHTML 1.0 Strict DTD, the align attribute is not supported.


The above is the detailed content of Do you know the specific usage of html tag legend? Detailed explanation of the attributes and usage of the legend tag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn