Skip to content

Instantly share code, notes, and snippets.

@hatefulcrawdad
Last active January 2, 2016 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hatefulcrawdad/8342255 to your computer and use it in GitHub Desktop.
Save hatefulcrawdad/8342255 to your computer and use it in GitHub Desktop.
Copy/paste from CSS Tricks for styling links based on href.
a[href^="http://"] {
/* fully valid URL, likely external link */
}
a[href="http://google.com"] {
/* link to specific website */
}
a[href^="/"], a[href^=".."] {
/* internal relative link */
}
a[href^="mailto:"] {
/* email link */
}
a[href$=".pdf"] {
/* PDF file */
}
a[href$=".doc"] {
/* Microsoft Word document */
}
a[href$=".mp3"] {
/* Music file */
}
a[href$=".zip"] {
/* Archive file */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment