While browsing at Forrst I saw this nice piece of CSS.

a[href^="http://"] {
        color: blue;
}
 
a[href^="mailto:"] {
        color: red;
}
 
a[href$=".pdf"] {
        color: green;
}

Styling links depending on their formats.

ajcates said:
For the sake of usability and consistency instead of changing the color on links based on their format I often times use this technique instead to add on little file icons.

  One Response to “Style links depending on url or file format”

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

   
© 2011 Joshua Lückers Suffusion theme by Sayontan Sinha