3 ms·
The "Use Attribute Selectors with Empty Links" tip[0] seems pretty pointless: a[href^="http"]:empty::before { content: attr(href); } So if there's no
by pc86 11y ago
The "Use Attribute Selectors with Empty Links" tip[0] seems pretty pointless:
a[href^="http"]:empty::before {
content: attr(href);
}
So if there's no link content, insert the URL as the content. That seems like a content issue and not a styling/CSS issue, and would break with any links where the "content" is a background image.
[0] https://github.com/AllThingsSmitty/css-protips#use-attribute-selectors-with-empty-links https://github.com/AllThingsSmitty/css-protips#use-attribute...
- extra88 11y agoAn empty <a> link will also likely fail accessibility tests and while the presentation is works for visual keyboard-only users, screen reader users will probably have problems.