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,22 @@
---
title: "Tip: Style links without a class"
shortTitle: Style default links
type: tip
language: css
tags: [visual,interactivity]
author: chalarangelo
cover: citrus-drink
excerpt: A short summary of your story up to 180 characters long.
dateModified: 2022-11-23T05:00:00-04:00
---
When styling injected or generated HTML content, you might not have access to the classes or IDs of the elements you want to style. This can become especially annoying when dealing with link elements. Luckily, you can use the `:not()` selector with an appropriate attribute selector to check for the absence of a class and style links accordingly.
```css
a[href]:not([class]) {
color: #0077ff;
text-decoration: underline;
}
```
As a bonus tip, you can use [the previous tip about selecting any link](/articles/s/css-select-any-link) to further enhance this solution.