/* Selects all elements with a href
   attribute value starting with "#". */
[href^="#"] {
    background-color: darkblue;
    color: white;
}
[href^="#"]::after {
    content: " 👇";
}
<p>See the following links.</p>
<ul>
    <li><a href="#subject-1">Subject 1</a></li>
    <li><a href="#contact">Contact</a></li>
    <li><a href="https://example.com/">Example Domain</a></li>
</ul>
Rendered Output
[href^="#"] {
    background-color: darkblue;
    color: white;
}

/* The following is also equivalent. */
[href^='#'] {
    background-color: darkblue;
    color: white;
}
/* Selects all elements with an href
   attribute value ending with ".html". */
[href$=".html"] {
    background-color: darkblue;
    color: white;
}
[href$=".html"]::after {
    content: " 📗";
}
<p>See the following links.</p>
<ul>
    <li><a href="home.html">Home</a></li>
    <li><a href="contact.html">Contact</a></li>
    <li><a href="https://example.com/">Example Domain</a></li>
</ul>
Rendered Output