Welcome to HTML5-Tutorials

Our site offers a lot of HTML5 learning from absolutely beginning to advanced level.If you want to make a website with HTML,this site will completely guide you a lot.So learn HTML5 syntax and form of coding easily with this website.If you have any doubt,leave a message on us.We will return you so soon.This site includes innumerable number of references you need to do after studying their corresponding elements.

In this page,we will learn about HTML <fieldset> tag.

Use of <fieldset> tag

The <fieldset> tag is used to define a group related element in an HTML form.
It draw a box of black-border around the content elements.

Display:Block

Example of <fieldset> tag

    <form>
       <fieldset>
          <legend> Contact Form </legend>
          Name: <input type="text"> <br><br>
          Address: <input type="text">
       </fieldset>
    </form>

Supported Browsers.

Tag
<fieldset> Yes Yes Yes Yes Yes

Full Code Example

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
<fieldset>
<legend> Demo Contact Form </legend>
Name: <input type="text"> <br><br>
E-mail: <input type="text"> <br><br>
Address: <input type="text"> <br><br>
</fieldset>
</form>
</body>
</html>

Output

Demo Contact Form
Name:

E-mail:

Address:

<legend> tag is used as caption in <fieldset> tag.

More Reference


<fieldset> tag defines a group-related form or section..

Default CSS Properties of <fieldset> tag

fieldset {
display:block;
margin:0px 2px 0px 2px;
padding:0.5em 0.75em 0.625em 0.75em;
border:2px groove;
}

Attributes of <fieldset> tag


Attribute Value Notes
disabled disabled
It defines all the contents within the <frameset> either may clickable button or input-type as disable.
form form_id
It defines one or more forms the fieldset belongs to.
name text
It defines a name for the fieldset.

Note that: All the above attributes are new in HTML5.