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
Linus Zoll
523 PointsDisplay to inline-block? Help!
Hello, I am currently making a Code Challenge and I can't pass. I don't know how to solve this:
"Select the list items inside the nav element and set their display to inline-block."
This is what I did, but it doesn't work:
nav ul {
margin: 0 10px 0 10px;
padding: 0;
list-style: none;
display: inline-block;
}
How do I need to write it correctly? I can't find anything on google which works for me. Thanks!
7 Answers
Anthony Goodier
14,557 PointsIt asks you to select - Select the list items inside the nav element
the selector for a list item is 'li'
Mark Casavantes
Courses Plus Student 13,401 PointsHi Linus,
You were close. I find that taking good notes and watching the videos more than once is helpful for me. I hope this helps you.
nav ul {
margin: 0 10px 0 10px;
padding: 0;
list-style: none;
}
nav li {
display: inline-block;
}
Victor Arredondo
Courses Plus Student 738 Pointsnav li { margin: 0 10px 0 10px; padding: 0; list-style: none; display: inline-block; }
changed the UL to IL
Cristi Sturgill
Courses Plus Student 29,577 PointsAdd nav li nav li { margin: 0 10px 0 10px; padding: 0; list-style: none; display: inline-block; }
Landon S
3,433 PointsYou will need to create a new nav element that allows you to select items from the list, don't cram them all into the nav ul { ;;info }. Create a new nav element with the selector for a list like what was previously mentioned. So:
nav li { display: inline-block; }
should work.
Irfan Setiadi
Courses Plus Student 2,638 Pointsnav ul {
margin : 0 10px;
list-style : none;
padding: 0;
}
nav li {
display : inline-block;
}
Anthony Goodier
14,557 PointsYou are currently selecting the UL element. Without giving you the answer, read the question over to see what it is specifically asking you to select.
Hope this helps.
Linus Zoll
523 PointsI tried it for 20 minutes with every thing, can you please help me a bit more? I am a beginner in the HTML and CSS stuff