Frontend Development

what is <legend> for?

Submitted by Lcasta07, , Thread ID: 207613

Thread Closed
30-05-2021, 01:16 AM
#1
Idk what it is for help pls

RE: what is <legend> for?

This post was last modified: 01-06-2021, 11:53 PM by Fishbone
#2
I don't know if you've already figured it out, but the <legend> tag basically defines a caption for a <fieldset> (set of fields in a form). You can see an example here of how it might be used. It helps visually group the fields together and helps for accessibility. This is what it might look like:

[Image: e6kosgW.png]

"Personalia" is the <legend> tag, and the rest are fields. It's grouped by <fieldset>.

RE: what is <legend> for?

#3
The <legend> tag defines a caption for the <fieldset> element.

You can see more here https://www.w3schools.com/tags/tag_legend.asp

RE: what is <legend> for?

#4
https://www.w3schools.com/tags/tag_legend.asp you can read more about that tag here

Users browsing this thread: 1 Guest(s)