TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML legend Tag

HTML legend Tag with html tutorial, tags, anchor, img, div, entity, textarea, marquee, p tag, heading tag, h1, h2, table, formatting, attribute, elements, ol, ul, Input Types, block element tag, inline element tag, html tags, phrase tag, head, body, form, lists, symbols etc.

<< Back to HTML

HTML <legend> tag

HTML <legend> tag is used to insert a title or caption to its parent element such as <fieldset>. The <legend> element must be the first child of <fieldset > element.

By using <legend> tag with <form> elements, it is easy to understand the purpose of grouped form elements.

Syntax

<legend> Content........<legend>

Following are some specifications about the HTML <legend> tag

Display block
Start tag/End tag Both Start and End tag
Usage textual

Example

<!DOCTYPE html>
<html>
<head>
<title>Legend Tag</title>
</head>
<body>
 <h1>Example of Legend Tag</h1>	
 <form>
              <fieldset>
		<legend>Employee basic information:</legend>
		<label>First Name</label><br>
		<input type="text" name="fname"><br>
		<label>Last Name</label><br>
		<input type="text" name="lname"><br>
		<label>Enter Email</label><br>
		<input type="email" name="email"><br><br>
		<input type="Submit"><br>
                </fieldset>
</form>
</body>
</html>
Test it Now

Output:

HTML legend tag

Attribute:

Tag-specific attributes:

Attribute Value Description
align
  • top
  • bottom
  • left
  • right
It specifies the alignment of the caption.
(Not Supported in HTML5)

Global attribute:

The <legend > tag supports the global attributes in HTML

Event attribute:

The <legend> tag supports the event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<legend>YesYesYesYesYes
Next TopicHTML lists




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf