Style links with no text
Displays the link URL for links with no text.
- Use the
:empty
pseudo-class to select links with no text. - Use the
:not
pseudo-class to exclude links with text. - Use the
content
property and theattr()
function to display the link URL in the::before
pseudo-element.
<a href="https://30secondsofcode.org"></a>
a[href^="http"]:empty::before { content: attr(href); }