Legend Tag in HTML || How HTML Tag Works
×

HTML LEGEND <legend> Tag

0 1022

HTML <legend> tag is used for providing a title or caption of <fieldset> Tag. It is used for defining the caption of sets of the fieldset. It is also known as parent tag.

It is coded in html as <legend></legend> having caption between them.

<!DOCTYPE html>
<html>
<head>
<title>Legend Tag</title>
</head>
<body>
<h1>Example of Legend Tag</h1>
<form>
<fieldset>
<legend>Student 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>

Output:




Share:


Leave a Reply


Comments
    Waiting for your comments