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

CSS CSS Flexbox Layout Flexbox Properties Growing Flex Items

Jason Brown
Jason Brown
9,626 Points

Div vs. li does it make a difference?

The items in the HTML are div elements as opposed to list items in an unordered list. Does this make any difference in flex grow properties? Can I do this for my navigation items instead of list items nested in a ul moving forward?

2 Answers

The biggest difference is semantics in the context of accessibility. To a sighted user like myself, it makes no difference to me whether something is a div or a list item because I do not inspect a page every time I land on one. However, to a non-sighted user the difference could be huge. A div has no semantic significance and therefore should only be used as a container or the like. A list item, however, will indicate to a non-sighted user that this is one item of possible several related items.

Steven Chandler
Steven Chandler
6,615 Points

Can you yes, should you probably not. But I'm just going off of the training videos