How to Align <legend> Tag Text to Center ?
The <legend> tag is used to define the title for the child contents. The legend elements are the parent element. This tag is used to define the caption for the <fieldset> element.
The <legend> align attribute in HTML is used to specify the alignment of the caption in a <fieldset> element. The left and right alignment of <legend> element are supported by major browsers except Opera 12 and earlier versions. The bottom alignment are not supported by any browsers.
We can use CSS to align <legend> tag element to center. The CSS margin-left property will play the vital role here to center the legend element.
Below example implements the above approach: