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 Advanced Selectors Substring Matching Attribute Selectors

John Enderby
John Enderby
11,730 Points

Multiple pseudo selectors possible?

Would it be possible to have multiple pseudo selectors for things i.e. if you wanted to use

a[attr$]:before

Would that be possible? That way we could use icons in the before pseudo class instead of using a background.

1 Answer

Yes, you could use an attribute selector to match links with a pdf extension for example and then combine with the :before or :after pseudo element selectors to add a pdf icon to your pdf links.

I believe one of the projects here covers this.

John Enderby
John Enderby
11,730 Points

Awesome. I thought you might be able to. Didn't know there was a project on that kind of thing later on but thanks for the answer