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

Why do we use <ul></ul> for navigation and gallery?

1)Why do we use <ul></ul> for navigation and gallery? Is it necessary to use them? What don't we use it in the footer?

2)When to use <div> and when to use <section>?

1 Answer

Steven Parker
Steven Parker
243,656 Points

:point_right: The <ul> and <ol> elements are for enclosing list items ("<li>").

You'll use then together, or not at all.

The differences between div and section are not in technical functionality, but intended usage: A <section> is a semantic element that implies a meaningful division in the document content. When properly used, a section will always include a header element containing an appropriate title for the section. If you were to prepare an outline of the document, each section title would appear in the outline.

A <div> is a generic enclosure that has no implications regarding content. It is often used only to isolate a particular area to apply CSS styling (something a section should never be used for).