Skip to content

Commit 8ec8434

Browse files
Added @nathansmith's "default" link tip 👏🏼
1 parent ee46c53 commit 8ec8434

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ A collection of tips to help take your CSS skills pro.
1414
1. [Equal Width Table Cells](#equal-width-table-cells)
1515
1. [Get Rid of Margin Hacks With Flexbox](#get-rid-of-margin-hacks-with-flexbox)
1616
1. [Use Attribute Selectors with Empty Links](#use-attribute-selectors-with-empty-links)
17+
1. [Style "Default" Links](#style-default-links)
1718

1819

1920
### Use `:not()` to Apply/Unapply Borders on Navigation
@@ -240,6 +241,20 @@ a[href^="http"]:empty::before {
240241
That's pretty convenient.
241242

242243

244+
### Style "Default" Links
245+
246+
Add a style for "default" links:
247+
248+
```css
249+
a[href]:not([class]) {
250+
color: #008000;
251+
text-decoration: underline;
252+
}
253+
```
254+
255+
Now links that are inserted via a CMS, which don't usually have a `class` attribute, will have a distinction without generically affecting the cascade.
256+
257+
243258
### Support
244259

245260
These protips work in current versions of Chrome, Firefox, Safari, and Edge, and in IE11.

0 commit comments

Comments
 (0)