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 How to Make a Website Styling Web Pages and Navigation Review: Styling Web Pages and Navigation

Marco Morales
Marco Morales
6,833 Points

Should "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
Isaac Asante
4,752 Points

Here, 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.

Marco Morales
Marco Morales
6,833 Points

Thanks. 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.

Isaac Asante
Isaac Asante
4,752 Points

You 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.