Thank you Rob.
This is worth a HowTo !
Just a tiny mistake in your code (from the test I made)
a[href$='.pdf'] { display:inline-block; padding-right:20px; background:transparent url(http://sitename/local--files/pagename/filename.gif) center left no-repeat; }
Since the last instruction, with "center left" will prepend the link with the icon, the instruction above should be "padding-left:20px".
About 20px: if icon width = 16, space between icon and link will be 20-16=4.
EDIT: from the tests I made with
a[href^="http:"] { display:inline-block; padding-right:14px; background:transparent url(http://sitename/local--files/pagename/filename.gif) center right no-repeat; }
this adds the icon also to images with links such as AddThis or social Bookmarking icons.
But this is about CSS, not Wikidot…
EDIT2:
See also this : http://pooliestudios.com/projects/iconize/ inspired by the link given by Rob above.