How to include a title in a fieldset in HTML?

HTMLWeb DevelopmentFront End Technology

Use the <legend> tag to include a title. The HTML <legend> tag s used to define a title for <fieldset> tag. It supports the following attribute −

Attribute
Value
Description
Align
top
bottom
left
right
Deprecated − Specifies the content alignment.

Example

You can try to run the following code to implement <legend> tag in HTML −

<!DOCTYPE html>
<html>
   <head>
      <title>HTML legend Tag</title>
   </head>
   <body>
      <form>

         <fieldset>
            <legend>Student Details</legend>
            Student Name: <input type = "text"><br />
            MBA Subjects:<input type = "text"><br />
         </fieldset>

      </form>
   </body>
</html>
raja
Published on 13-Mar-2018 12:10:19
Advertisements