Skip to content

Instantly share code, notes, and snippets.

@nfreear
Last active July 9, 2016 02:51
Show Gist options
  • Save nfreear/1284413 to your computer and use it in GitHub Desktop.
Save nfreear/1284413 to your computer and use it in GitHub Desktop.
CSS3 selectors to add icons (favicons) to a user-profile list
/* CSS3 selectors. */
.pr li{ margin:2px 0; }
.pr [href*=":"]{padding-left:28px; /*24px*/ background-repeat:no-repeat; background-position:left; background-size: 16px 16px; }
.pr [href*="open.ac.uk"]{background-image:url(http://www3.open.ac.uk/favicon.ico) /*http://openlearn.open.ac.uk/favicon.ico*/ }
.pr [href*="cloudworks.ac.uk"]{background-image:url(http://cloudworks.ac.uk/themes/cloudworks/favicon.ico)}
.pr [href*="facebook.com"]{background-image:url(http://facebook.com/favicon.ico)}
.pr [href*="linkedin.com"]{background-image:url(http://www.linkedin.com/favicon.ico)}
.pr [href*="google.com"]{background-image:url(http://www.google.com/favicon.ico)}
.pr [href*="s.google.com"]{background-image:url(http://plus.google.com/favicon.ico);} /*plus., profiles. */
.pr [href*="twitter.com"]{background-image:url(http://twitter.com/favicon.ico)}
.pr [href*="yahoo.co"]{background-image:url(http://www.yahoo.com/favicon.ico)}
.pr [href*="delicious.com"]{background-image:url(http://delicious.com/favicon.ico)}
.pr [href*="scoop.it"]{background-image:url(http://www.scoop.it/resources/img/favicon.ico) /*http://scoop.it/favicon.ico*/ }
.pr [href*="slideshare.net"]{background-image:url(http://www.slideshare.net/favicon.ico)}
.pr [href*="youtube.com"]{background-image:url(http://www.youtube.com/favicon.ico)}
.pr [href*="flickr.com"]{background-image:url(http://www.flickr.com/favicon.ico)}
.pr [href*="github.com"]{background-image:url(http://github.com/favicon.ico)}
.pr [href*="bitbucket.org"]{background-image:url(https://bitbucket.org/favicon.ico)}
.pr [href*="ohloh.net"]{background-image:url(http://www.ohloh.net/favicon.ico)}
.pr [href*="scraperwiki.com"]{background-image:url(https://scraperwiki.com/favicon.ico)}
.pr [href*="moodle.org"]{background-image:url(https://moodle.org/theme/image.php/moodleorgcleaned_moodleorg/theme/1436262404/favicons/org/favicon.ico) /*http://moodle.org/theme/moodleofficial/pix/favicon.ico*/ }
.pr [href*="ERROR_gawds.org"]{background-image:url(http://www.gawds.org/favicon.ico)} /* XX */
.pr [href*="mozdev.org"]{background-image:url(http://mozdev.org/favicon.ico)}
.pr [href*="gravatar.com"]{background-image:url(http://en.gravatar.com/favicon.ico)}
.pr [href*="cuwebd.ning"]{background-image:url(http://cuwebd.ning.com/favicon.ico)}
.pr [href*="openlibrary.org"]{background-image:url(http://openlibrary.org/favicon.ico)}
.pr [href*="librarything.com"]{background-image:url(http://www.librarything.com/favicon.ico)}
.pr [href*="orcid.org"]{background-image:url(http://orcid.org/favicon.ico)}
.pr [href*="drupal.org"]{background-image:url(http://drupal.org/favicon.ico)}
.pr [href*="wordpress."]{background-image:url(http://en.wordpress.com/favicon.ico)}
a.logo{border:1px solid transparent; border-radius:5px; display:inline-block; padding:7px;}
a.logo:hover, a.logo:focus{border:1px solid #ccc; box-shadow:inset 0 0 5px #bbb;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment