Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Forms Organizing Forms Fieldsets and Legends

Jack Cummins
Jack Cummins
17,417 Points

Why can't you just use an ol.

I don't get it

Dave StSomeWhere
Dave StSomeWhere
19,870 Points

Need a little more info - what don't you get?

4 Answers

Max Senden
Max Senden
23,177 Points

Hi Jack,

<ol> and <ul> are only used as parent elements for list items <li>. Putting fields or labels in an ordered list or unordered list will only complicate things once you start styling them in CSS.

Hope it helps, Max

jeffrey bachynski
jeffrey bachynski
5,179 Points

The simple answer is they are differnt elements. You can use an ol to get something similar but they are not the same. (For one thing, the <fieldset> has a <legend> tag that you can use.)

"The HTML <ol> element represents an ordered list of items, typically rendered as a numbered list." See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol for more info about ordered lists.

"The HTML <fieldset> element is used to group several controls as well as labels (<label>) within a web form." See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset for more information about fieldsets.

You can nest controls in the <li> elements of an <ol> or an <ul> and put it all inside of a <fieldset>, and you might have a good reason to do so sometimes, but like Max said, you might find that would complicate things.

U can use if It necessary for u project .but mostly it ul as list parent. Hope that helps

Jack Cummins
Jack Cummins
17,417 Points

Thanks for the help!