Created
November 14, 2013 04:08
-
-
Save carlos-sanchez/7461191 to your computer and use it in GitHub Desktop.
Link Selectors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* enlaces externos | |
^= indica que queremos dar estilo a aquellos enlaces que comiencen por http:// | |
*/ | |
a[href^="http://"]{ | |
padding-right: 20px; | |
background: url(external.gif) no-repeat center right; | |
} | |
/* emails | |
^= indica que queremos dar estilo a aquellos enlaces que comiencen con mailto: | |
*/ | |
a[href^="mailto:"]{ | |
padding-right: 20px; | |
background: url(email.png) no-repeat center right; | |
} | |
/* pdfs | |
$= indica que queremos dar estilo a aquellos links cuyos hrfs terminen con ".pdf". | |
*/ | |
a[href$=".pdf"]{ | |
padding-right: 20px; | |
background: url(pdf.png) no-repeat center right; | |
} | |
/* zip | |
Igual que el anterior pero para los archivos zip y se añade un icono a la derecha del enlace. Por ello lo de :after | |
*/ | |
a[href$=".zip"]:after{ | |
content: url(icons/zip.png); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment