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

ul's or div's? whats better or are they just personal preferences?

what advantages will ul have against div?

2 Answers

Although ul and div are both block level elements, they aren't interchangeable.

ul stands for unordered list, and should only be used as the parent element for li elements when you're creating lists that are not numbered (ie unordered). When creating numbered/ordered lists, you would use an ol (ordered list) element instead.

div stands for division (more specifically HTML Document Division Element), and is used to break up groups of lower-level elements.

In Nick's HTML Course, you'll get a great explanation of each element and its appropriate usage.

Thank you will do.