Nest all content into snippets

This commit is contained in:
Angelos Chalaris
2023-05-07 16:07:29 +03:00
parent 2ecadbada9
commit 6a45d2ec07
1240 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,25 @@
---
title: Style links with no text
type: snippet
language: css
tags: [visual]
author: chalarangelo
cover: metro-tunnel
dateModified: 2022-11-11T05:00:00-04:00
---
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 the `attr()` function to display the link URL in the `::before` pseudo-element.
```html
<a href="https://30secondsofcode.org"></a>
```
```css
a[href^="http"]:empty::before {
content: attr(href);
}
```