Categories

Featured templates

Drupal 7.x. How to replace FontAwesome icons with images

Stacy Martin January 16, 2015
Rating: 5.0/5. From 1 vote.
Please wait...

This tutorial shows how to replace FontAwesome icons with image in Drupal 7.

Drupal 7.x. How to change iconic font icon with an image

FontAwesome icons can be replaced with image in CSS files:

  1. Click F12 or rightclick the icon you’re about to change and select the Inspect Element option to open Firebug Inspect element tool in your browser.

  2. Rollover the icon you would like to replace with the image in order to find file and line which stores the icon code:

    Drupal7.Replace iconic font with image-1

  3. Upload the image into the sites/all/themes/themeXXX/images directory on server, where themeXXX is the theme name:

    Drupal7.Replace iconic font with image-2

  4. Open the required file with Dreamweaver or Notepad on server, locate the line with the following code:

    a.tm-follow-link-facebook:before {
    	content: "\f0d5";
    }
    

    Replace it with:

    a.tm-follow-link-facebook:before {
        background: url("http://yourwebsite.com/sites/all/themes/themeXXX/images/facebook.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
        content: "";
        height: 43px;
        position: absolute;
        width: 43px;
    }
    

    Make sure to replace http://yourwebsite.com/sites/all/themes/themeXXX/images/facebook.png with correct path to your image and change the image name accordingly. Also, you will need to adjust “height” and “width” values according to your image dimensions.

  5. Refer to the How to create CSS rules for specific page in WordPress, Joomla and Drupal tutorial to learn how to find files and lines with the Inspect Element tool.

  6. You may need to add element top/left or bottom/right properties in the CSS to adjust the image position.

  7. Save the changes in the updated file and upload it on the server. Overwrite the existing file with the updated one:

    Drupal7.Replace iconic font with image-3

  8. Refresh page with Control/Command+F5 keys:

    Drupal7.Replace iconic font with image-4

Feel free to check the detailed video tutorial below:

Drupal 7.x. How to change iconic font icon with an image

Premium Drupal Themes
This entry was posted in Drupal Tutorials and tagged drupal, font, icon, iconic, image. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket