Example 1 — Style New-Tab Links
Highlight anchors that open in a new tab.
<style>
a[target="_blank"] {
color: #b91c1c;
font-weight: 600;
text-decoration: underline;
}
</style>
<a href="https://example.com" target="_blank">New tab</a>
<a href="/about">Same tab</a> How It Works
- Pick the attribute.
targetcontrols where the link opens. - Require the full value.
="_blank"matches only that exact string. - Style matches. The new-tab link turns red and bold.
- No partial match. Links without
target, or with another value, stay normal.

