Created
June 9, 2014 14:33
-
-
Save mrwweb/4010d08929fab1b175f5 to your computer and use it in GitHub Desktop.
CSS to automatically add a filetype to the end of a link. (e.g. "[PDF]") This is a best practice for accessibility and usability. Add or remove types as you see fit.
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
/* ID Link Mimetypes for Common Filetypes */ | |
a[href$=".doc"]::after { | |
content: " [DOC]"; | |
} | |
a[href$=".docx"]::after { | |
content: " [DOCX]"; | |
} | |
a[href$=".rtf"]::after { | |
content: " [RTF]"; | |
} | |
a[href$=".pdf"]::after { | |
content: " [PDF]"; | |
} | |
a[href$=".xls"]::after { | |
content: " [XLS]"; | |
} | |
a[href$=".xlsx"]::after { | |
content: " [XLSX]"; | |
} | |
a[href$=".csv"]::after { | |
content: " [CSV]"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment