Example 1 — Style All English Locales
Match en, en-US, and en-GB with one rule.
<style>
[lang|="en"] {
color: #1d4ed8;
font-weight: 600;
}
</style>
<p lang="en-US">American English</p>
<p lang="en">Base English</p>
<p lang="fr">Français</p> How It Works
- Choose
lang. HTML language tags often use primary-region form. - Query the primary tag.
|=enmeansenoren-*. - Style matches. Both English lines turn blue and bold.
- Skip others.
frdoes not start withen-, so it stays normal.

