Example 1 — Match a Class Token
Style any element that includes the whole word lead in class.
<style>
[class~="lead"] {
color: #1d4ed8;
font-weight: 600;
}
</style>
<p class="intro">Welcome</p>
<p class="intro lead">Lead intro</p>
<p class="lead">Lead only</p> How It Works
- Read the list.
classholds space-separated tokens. - Require a whole word.
~="lead"matches the tokenlead. - Style matches. Both lines that include
leadturn blue. - Skip others.
introalone has noleadtoken.

