/* href属性の値が
   "#"で始まるすべての要素を選択します。 */
[href^="#"] {
    background-color: darkblue;
    color: white;
}
[href^="#"]::after {
    content: " 👇";
}
<p>次のリンクをご覧ください。</p>
<ul>
    <li><a href="#subject-1">トピック-1</a></li>
    <li><a href="#contact">お問い合わせ</a></li>
    <li><a href="https://example.com/">Example Domain</a></li>
</ul>
実際の適用例
[href^="#"] {
    background-color: darkblue;
    color: white;
}

/* 次のように記述しても同じです。 */
[href^='#'] {
    background-color: darkblue;
    color: white;
}
/* href属性の値が
   ".html"で終わるすべての要素を選択します。 */
[href$=".html"] {
    background-color: darkblue;
    color: white;
}
[href$=".html"]::after {
    content: " 📗";
}
<p>次のリンクをご覧ください。</p>
<ul>
    <li><a href="home.html">ホーム</a></li>
    <li><a href="contact.html">お問い合わせ</a></li>
    <li><a href="https://example.com/">Example Domain</a></li>
</ul>
実際の適用例