Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Fieldset Element
Fieldset Element

Fieldset is used to combine all form elements. It displays elements as a block and legends element is used along with fieldset to provide easiness to users.

Syntax

<form>
<fieldset>
<legend>Form</legend>
<input type=text />
</fieldset>
</form>


You can use fieldset and legend elements any where within an HTML document.


Example

Form

Fieldset and Legend are pair tags and output of both is border aound whole element like you can see in above example.


Practice Task

Open notepad or any other text editor, follow the following points.


  • Create a form
  • Apply fieldset around form
  • Add legend
  • Create one input field type password

save file with name task.html or task.htm and then open it using any browser and see results.


Solution

Form

Don't forget fieldset and legend are non empty elements which means they always come in pair.