logo dark logoo light logo
  • Home
  • About Us
  • Our Services
    • WordPress Support Fixing @Instant
    • WordPress Loading Speed
    • WordPress Site Migration
    • WordPress Theme Customization
  • Contact US
  • Raise a TIcket
logo dark logoo light logo
  • Home
  • About Us
  • Our Services
    • WordPress Support Fixing @Instant
    • WordPress Loading Speed
    • WordPress Site Migration
    • WordPress Theme Customization
  • Contact US
  • Raise a TIcket
mobile logo
  • Home
  • About Us
  • Our Services
    • WordPress Support Fixing @Instant
    • WordPress Loading Speed
    • WordPress Site Migration
    • WordPress Theme Customization
  • Contact US
  • Raise a TIcket

If an link is a PDF file, style accordingly

Solution:

This can be done with just CSS and it supports all major browsers including IE7+. There is no need to add any extra classes or <img> elements.

The CSS below will target any link to a .pdf, change the link color, give it some left padding and apply a background image in the space created:

a[href$=".pdf"] {
    background: url(images/pdf-icon.png) no-repeat 0 50%;
    padding-left: 25px;
    color: red;
}

Demo: http://jsfiddle.net/xuBpG/1/

Web Centauri Technologies

About Us

We are aware of the technology that will best portray your website online. We have the expertise to maintain your website current with the newest web updates and technology.









  • Contact Us

Web Centauri Technologies | © | All Rights Reserved |

Work illustrations by Storyset & Images by Pexels