Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed HTML Forms!
You have completed HTML Forms!
Preview
Sometimes, certain form controls belong together in a logical grouping. Form controls can be grouped together using fieldsets and then labeled using a legend.
HTML Elements
- The
fieldset-element wraps multiple form elements into common groups. This can help organize a form and make it easier to understand for users. - The
legend-element is similar to the label element, but instead of labeling a form control, it labels a fieldset. Adding a legend to a fieldset can provide some helpful context for users that are filling out a form.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Sometimes, certain form controls belong
together in a logical grouping.
0:00
For example, if our sign up form included
a physical mailing address, we
0:00
would want to make sure all of that data
was visually grouped together.
0:05
In our case, we want to make two groups.
0:09
One for basic information, and one for the
information that will show
0:11
up on a user's profile, after they've
logged into our imaginary app.
0:16
We can do that by wrapping our form
controls in the field set element.
0:21
So let's try that out.
0:26
Just after the h1, I'm going to type
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up