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

Combination of selectors- *[class~= black]?

Just saw this in an email code. Why combining these two selectors? universal and attribute~=

*[class~=m_br_r5]

2 Answers

Steven Parker
Steven Parker
243,656 Points

This selector combination seems to be for a specific class.

The selector "*[class~= black]" would select any element that had the class black,
and the selector "*[class~=m_br_r5]" would select any element that had the class m_br_r5.

Where did you see these? It's not clear to me that these would operate any differently that the normal class selectors ".black" and ".m_br_r5".

Hi Steven

I săw this in an email markup, thinking it could be an email hack to get the right rendered look in a quirky email client.