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 Foundations Text, Fonts, and Lists List Styles

Natalia C.
Natalia C.
2,027 Points

list-style-image & background-image

In this video, Guil chooses to use the background-image property to add custom images to the ul list instead of bullet points.

I can see the benefits versus list-style-image property.

I have one question though: Is there a reason why he didn't choose the ::before pseudo-element?

Would that be the same / worse / better ?

:)

Thanks!

2 Answers

Anna Dadej
Anna Dadej
10,707 Points

As I see, we have similar concerns :) I was also wondering about that and I found this explanation http://css-plus.com/2011/12/control-your-list-items/

Natalia C.
Natalia C.
2,027 Points

Haha! :) Feels good to know I'm not alone. Thanks for answering (again!). Btw, perhaps it'd be easier to give me your number to bug you whenever I want? :P ha ha ha ha :D

Aha! So, according to css-plus, using pseudo-elements not only makes sense, but -in fact- it's better! Good to know. Although I have to admit I'll need to read a little more about the counter() function, since it's the first time I'm seeing this. Seems helpful for other uses too (one I could think about is a TOC if you set it to count headings for example).

Thanks so much Anna Dadej !!!!