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!

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

CSS How to Make a Website Styling Web Pages and Navigation Style the Portfolio

Sloane Weston
Sloane Weston
1,103 Points

What is the benefit to using an unordered list to display the gallery as opposed to wrapping the images in div tags?

I was just curious why an unordered list is a better choice than using div or figure tags around the images?

1 Answer

Brian Pohuski
Brian Pohuski
5,386 Points

Logically speaking, having anything in a list specifies a group of similar items or order. Not all scenarios would be better for a gallery to be in a list, but for a screen reader, having gallery descriptive text in a list format might provide a little direction.

Additionally, instead of using an unordered list, you could take advantage of the rarely-used definition list:

``` by using its title

<dt> ``` to specify semantically the title for each gallery item. Chris Coyier provides some insight here: http://css-tricks.com/utilizing-the-underused-but-semantically-awesome-definition-list/

All of that being said, depending on your instance of the gallery, you might be better off using a different solution based on your needs. As usual, do some research into what works best for you and go with it. Perfection is the enemy of progress!

Happy coding!