AndrewMk AndrewMk - 1 month ago 8
HTML Question

Legend tag does not display

I try the

<legend></legend>
tag in html, but it does not display at all.
I reviewed W3school legend tag and it does not seem to be a deprecated tag.
Why the style of the tag (the bordert that passes through the word that I write) does not show like in w3school example?

<form>
<legend>Form Input</legend>
</form>

Answer

You need to have <fieldset> around <legend> and all of the content inside the <form>. Here is your better code:

<form>
  <fieldset>
<legend>Form Input</legend>
    </fieldset>
</form>

w3schools does also say this in the editor