html tutorial - <legend> - Legend Tag in HTML - html5 - html code - html form

legend tag in html

Learn html - html tutorial - legend tag in html - html examples - html programs

  • The <legend> tag is used to define as a caption for the <fieldset> tag.
  • Both the <legend> tag can be used in conjunction with <fieldset>, <details> and <figure> tag.
  • The <legend> tag supports the Global Attributes and Event Attribute.

Syntax for <legend> tag:


Differences between HTML 4.01 and HTML 5 for <legend> tag:

HTML 4.0.1

  • HTML4 supports align attribute.


  • HTML5 does not supports align attribute.

Sample Coding for <legend> tag:

Tryit<!DOCTYPE html>
<html >
                <legend>Wikitechy Database</legend>
                 Name:<input type="text" size="30"><br><br>
                 DOB:<input type="text" size="30"><br><br>
                 Designation:<input type="text" size="10">

Code Explanation for <legend> tag:

<legend> Tag Code Explanation

  1. The <legend> tag is used to define a caption for the <fieldset> tag within the <form> tag to form the design for Personal details.

Output for <legend> tag:

<legend> Tag Output

  1. Output displays the Wikitechy Database form details with the caption.

Attribute of <legend> tag:

Attribute Value HTML4 HTML5 Description
align top
Yes No It is used to specify the alignment of the captions.

Browser Support for <legend> tag in HTML:

Yes Yes Yes Yes Yes

Related Searches to legend tag in html

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add to your ad blocking whitelist or disable your adblocking software.