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 trialsagnikchakraborti
929 PointsWhy doesn't display:inline-block work for image gallery li instead of float:left?
When we built the image gallery we put float:left for #gallery li and display:inline-block for nav li. Why won't display:inline-block work for the gallery li? Need some expanation. Since both the things are list items, it should work.
gregory gordon
Full Stack JavaScript Techdegree Student 14,652 PointsThey are both li but in different areas(class,id,nav so on....) and with different styles im sure inline-block and float will make the appearance different.
1 Answer
Jason DeValadares
7,190 PointsI think the reason he's done this is because as a block it would put all the images into a blocked area (all lined up without breaks). Because he wants everything to flow and move around depending on the size of the screen, he's left it with defaults and just told it to float what it can beside each other.
Sara Hardy
8,650 PointsSara Hardy
8,650 PointsI haven't watched the course so I can't speak specifically to your case, but display: inline-block should work in general to display your list items as a grid. Have you tried it? What happens? Can you show your code?