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 Selectors Going Further with Attribute Selectors and Pseudo-Classes Element States Pseudo-Classes

Aaron Coursolle
Aaron Coursolle
18,014 Points

Pseudo Elements and Element States Pseudo Classes?

I basically need a hook to hang my hat. I get the "Pseudo" part--anything labeled Pseudo simply means that it isn't explicitly in the code. But what is the difference between a Pseudo Element and Element States Pseudo Class?

1 Answer

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

I think this post on Stack Overflow might help. Basically, this is how it works:

Pseudo-Classes

The pseudo-class concept is introduced to permit selection based on information that lies outside of the document tree or that cannot be expressed using the other simple selectors.

Pseudo-Elements

Pseudo-elements create abstractions about the document tree beyond those specified by the document language.