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 trialMarco Morales
6,833 PointsShould "Which of the following CSS declarations will allow list items to appear horizontally?" have 2 possible answers?
The choices are:
- display: inline-block;
- display: none;
- display: inline;
- display: block;
Both "inline-block" and "inline" are correct, but "inline" gives a wrong response.
2 Answers
Isaac Asante
4,752 PointsHere, what you want is to have list items displayed inline with other elements, and each list item displayed as block items. So only "inline-block" is correct.
Isaac Asante
4,752 PointsYou can consider it as an exercise to memorize everything you saw in the video. So the video emphasized on inline and blocked li elements. This explains why the quiz is "forcing" you to select the inline-block answer. It's more beneficial to memorize inline-block which combines the profits of both values (inline and block), than inline only.
Marco Morales
6,833 PointsMarco Morales
6,833 PointsThanks. In the context of the exercises, "display: inline-block" is correct. But the question doesn't specifically ask anything that would limit the answer to inline-block. It only asks that list items appear horizontally. Both "display: inline" and "display: inline-block" would result in the list items being inline of each other horizontally. For this question to have only one possible answer, it should add another part that differentiates inline from inline-block, eg. width and height which was mentioned in the exercises.