Example

A simple <legend> tag:

Laboratory

description & Usage

The <legend> tag is used to provide a caption for the content inside the <fieldset> tag.

For more information, please refer to the <fieldset> tag page.

Browser compatibility and Support

# Chrome Edge Firefox Safari Opera
<legend>

Global Attributes

The <legend> tag supports the HTML Global Attributes.

Event Attributes

The <legend> tag supports the HTML Event Attributes.

More Examples

Example

<legend> HTML tag with custom style -Example #1

Laboratory

Default CSS

Most browsers will display the <legend> tag with the following default style: