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 Basics (2014) Basic Layout Lists

Can we not use list-style-position under li as opposed to writing out ul, ol?

At around 3.30 Guil makes the list markers appear in the in the border by making a CSS rule that applies to both ul, ol lists. Could he not just have applied that rule to the li declaration right below?

Thanks in advance

Henry

2 Answers

Hi, Henry, He would need to specify that what he was making is a list item. Li is a child element of a Ul or a Ol and those are parents. so unless you specify that it is a list the computer isn't going to understand what your telling it. Li can't stand on its own.

list-style-position is what you can do with the actual list. so, you cant apply it to a list if you haven't specified what kind of list it is or if its even a list at all. just putting li doesn't tell the computer what type of list it is.

Hope this is a helpful answer.

Thank you Chanel. Understood now!