Links mit einem bestimmten Filetype

Armin Bartsch, Freitag, 17. September 2010

Dieses Beispiel kann auf alle beliebigen Filetypes angewendet werden.

CSS bietet eine gute Möglichkeit Links je nach Filetype zu formatieren.  Es kann dann auf JavaScript oder zusätzlich id/class - Angaben verzichtet werden.

a[href $='.pdf'] { padding: 5px 0 5px 20px; background: url(icons/pdf.gif) no-repeat center left; } a[href $='.doc'] { padding: 5px 0 5px 20px; background: url(icons/doc.gif) no-repeat center left; } a[href $='.xls'] { padding: 5px 0 5px 20px; background: url(icons/xls.gif) no-repeat center left; }
  1. a[href $='.pdf'] {
  2.    padding: 5px 0 5px 20px;
  3.    background: url(icons/pdf.gif) no-repeat center left;
  4.    }
  5. a[href $='.doc'] {   
  6.    padding: 5px 0 5px 20px;
  7.    background: url(icons/doc.gif) no-repeat center left;
  8.    }
  9. a[href $='.xls'] {
  10.    padding: 5px 0 5px 20px;
  11.    background: url(icons/xls.gif) no-repeat center left;
  12.    }
  13.  

Weiterfuehrende Information

Entwicklungsumgebung

TYPO Version:
4.3.1

Sponsored by:

ideenwerft webhosting
ideenwerft caretaker