How to Use Icon Fonts on Your Divi Website

In December we released a pack of 100 Line Style Icons. Today we are giving you exactly the same icons but in web font format with an extensive tutorial on how to add them to your website.

Using icon fonts has become a web design trend very quickly and there is a good reason for that – icon fonts give us unlimited possibilities of customizing the icons with CSS code. And aside from giving designers and developers more control – icon fonts also offer many features that bitmap image icons simply do not. Because the icon is actually a font character, it has the same properties as all other fonts, which means it is vector and scales splendidly no matter the size. This is extremely precious considering the increasing popularity of the retina displays.

Using icon font instead of icons images will also improve our site performance. We can use even 1000 icons on one page and they will be loaded only once, as a code, but if we use bitmap images – 1000 images will have to be loaded!

Below are the steps to embed and use a custom icon fonts on your very own website.

 

See Demo    Download Icon Font

Embedding an Icon Font


1. Download the Icon Font you wish to use.

In this tutorial we will be using the files from the download above, which contains an icon font we designed and generated with Icomoon. This package also includes JSON file with 3 samples that can be imported directly to your Divi library.

2. Open fonts folder and copy the code from “style.css” and paste it into your own “style.css” file.
This CSS file embeds the icon font via @font-face, and has a unique class for each icon, telling it which character in the font to use. This is also where unique styling can be added to each icon, however, to use different styles across your website it is recommended to add a new class for each new style.

We always recommend using a child theme for this. For more information on child themes see this article:
Child Theme Tutorial.

3. Copy the “fonts” folder into your theme directory:
/wp-content/themes/yourtheme/
If your theme directory already has a “fonts” folder, drag the contents from “fonts” into the existing folder.

Note: to edit your Child Theme files you need to connect to your server via FTP or use a File Manager (eg. in cPanel).

How to use Icon Font


1. Disable Visual Text Editor

If you are using WordPress you will need to disable Visual Text Editor because custom fonts will not work with it and you may lose all icon code added after saving the page. The safest way to use custom icon font within your WP installation is to disable Visual Text Editor. This can be done in Users/Your Profile.

2. You can now use your font across your website by adding icon classes or attributes.
Adding custom icon to the page is quite simple. We just need to add icon class to the text module using HTML icon tag. We can also an add additional class that will allow us to style selected icons just as we want.

We have prepared 3 Demo Sections to show you some samples of using custom fonts on your website. These all sections are included in the download package and can be imported to your Divi Library and added to any page on your website with ease. The icon package can be downloaded here.

Note: JSON file imported to your Divi library has a CSS styles embedded into first section.

Demo 1


For this section we used 3 Text Modules with HTML code inside.
Each Text Module has a blue icon, a title and description. Icons are added using icon class. All classes and unicodes can be found here. For this sample we also added 2nd class demo-blurb that will allow us to customize the icons. We defined font-size and icon color. For title we used H4 tag and Paragraph for description text.

See Demo


To style the icons we need to add a little of CSS to our style.css file located in a child theme folder or to Divi/Theme Options/Custom CSS.

Demo 2


In the second sample showcased in this article we also used Divi Text Modules but this time we added icons as a module background and added some more custom CSS so each box is changing appearance on mouseover.

See Demo

1. Add a row with 2 columns layout and tweak Gutter Options in Row Settings.
Open Row Module Settings, go to Design tab and set Use Custom Gutter Width to YES  and Gutter Width to 1.
These settings will remove spaces between boxes.
2. Add 4 Text Modules and customize their settings.
Each Text Module must have a custom class added and must be positioned relatively. All these adjustments can be tweaked in Text Module Settings under Advanced tab.
Note: Each module will have a different class: icon_wrap_a, icon_wrap_b, icon_wrap_c and icon_wrap_d. This will allow as to set different icon for each box.
Tip: It is a good practice to customize one module first and then copy it to other columns and change only class accordingly so all modules have the same settings and same appearance.
3. Add Text Module title, description and set background color.
Now we will add title and description to our Text Module Content tab and set background to #75797d
4. Add custom CSS
In this last step we only need to add Custom CSS. We will add icon attribute as a background, hover effect and add transition so all is working nice and smooth. Custom CSS should be added to you child theme style.css file or to Divi/Theme Options/Custom CSS.

Demo 3


Demo 3 is very similar to Demo 1 but we styled icons to be a circle, added blue background color and subtle icon animation on mouseover.

See Demo

1. Add a row with 3 columns layout.
For this sample we used 3 columns layout and 3 Text Modules. Each module has an icon with additional class, title and description. We will style icon by adding CSS styles to demo-circle-blurb class.
2. Add class to each Text Module.
To add animation when user mouseover on the box (not the icon) we need to add class to each Text Module. To do that open Advanced tab and add demo-circle-blurb-box class.
3. Add custom CSS.
This custom CSS will set our circle icon color and add nice icon animation on mouseover. This code should be added to your Divi child theme or to Divi/Theme Options/Custom CSS.

Wait! And what about Divi Icons PRO!

If you don’t feel comfortable with adding custom code to your website, Divi Icons PRO is for you! The FREE version of the plugin adds 360 custom line style icons to your Divi Builder so you can easily use these icons on your pages. The premium version of the plugin adds over 2500 icons in total!

 

Maciej Ekstedt

Maciej Ekstedt

Maciej is the founder and CEO of B3 Multimedia Solutions. He is a self-made web designer and marketing expert, and he loves his job so much that he barely leaves the office. He transforms creative ideas into effective strategies for his company and for his clients. Maciej is fascinated by the phenomenon of megalopolis. He notices patterns and details which make up the whole thing, and he uses these skills in his work.

Demo 1

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Demo 2

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Demo 3

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Blurb Title

Praesent gravida pharetra justo, sit amet congue elit egestas vitae. Ut posuere nisi ullamcorper erat posuere volutpat.

Line Style Icons
Class names and unicodes
­­­

.icon-bag [&#xe900]

­

.icon-bike [&#xe902]

­

.icon-boxes [&#xe904]

­

.icon-browser-search [&#xe906]

­

.icon-calendar [&#xe908]

­

.icon-chart-desktop [&#xe90a]

­

.icon-chat-bubbles [&#xe90c]

­

.icon-check-square [&#xe90e]

­

.icon-clock [&#xe910]

­

.icon-connections  [&#xe912]

­

.icon-cup [&#xe914]

­

.icon-cv [&#xe916]

­

.icon-desktop-code [&#xe918]

­

.icon-desktop-settings [&#xe91a]

­

.icon-diamond [&#xe91c]

­

.icon-documents [&#xe91e]

­

.icon-drop [&#xe920]

­

.icon-expand [&#xe922]

­

.icon-folder [&#xe924]

­

.icon-heart [&#xe926]

­

.icon-image [&#xe928]

­

.icon-layers [&#xe92a]

­

.icon-link [&#xe92c]

­

.icon-map-marker [&#xe92e]

­

.icon-megaphone [&#xe930]

­

.icon-paperclip [&#xe932]

­

.icon-pencil [&#xe934]

­

.icon-photoshop [&#xe936]

­

.icon-pricing [&#xe938]

­

.icon-raport [&#xe93a]

­

.icon-responsive [&#xe93c]

­

.icon-search [&#xe93e]

­

.icon-selection [&#xe940]

­

.icon-shopping-cart [&#xe942]

­

.icon-slider [&#xe944]

­

.icon-support [&#xe946]

­

.icon-tags [&#xe948]

­

.icon-thunderbolt [&#xe94a]

­

.icon-user [&#xe94c]

­

.icon-vector [&#xe94e]

­

.icon-wallet [&#xe950]

­

.icon-globe [&#xe952]

­

.icon-lamp [&#xe954]

­

.icon-typography [&#xe956]

­

.icon-star [&#xe958]

­

.icon-discover [&#xe95a]

­

.icon-disposable-cup [&#xe95c]

­

.icon-research [&#xe95e]

­

.icon-meter [&#xe960]

­

.icon-conversation [&#xe962]

­

.icon-beaker [&#xe901]

­

.icon-box [&#xe903]

­

.icon-briefcase [&#xe905]

­

.icon-browser [&#xe907]

­

.icon-camera [&#xe909]

­

.icon-chart [&#xe90b]

­

.icon-check-circle [&#xe90d]

­

.icon-click [&#xe90f]

­

.icon-color-picker [&#xe911]

­

.icon-credit-card [&#xe913]

­

.icon-customizer [&#xe915]

­

.icon-desktop-chart [&#xe917]

­

.icon-desktop-rocket [&#xe919]

­

.icon-desktop-windows [&#xe91b]

­

.icon-divi [&#xe91d]

­

.icon-download [&#xe91f]

­

.icon-envelope [&#xe921]

­

.icon-flag [&#xe923]

­

.icon-glass [&#xe925]

­

.icon-illustrator [&#xe927]

­

.icon-key [&#xe929]

­

.icon-lightbulb [&#xe92b]

­

.icon-lock [&#xe92d]

­

.icon-map [&#xe92f]

­

.icon-mobiles [&#xe931]

­

.icon-paperplane [&#xe933]

­

.icon-phone [&#xe935]

­

.icon-piechart [&#xe937]

­

.icon-question [&#xe939]

­

.icon-refresh [&#xe93b]

­

.icon-rocket [&#xe93d]

­

.icon-security [&#xe93f]

­

.icon-settings [&#xe941]

­

.icon-sidebar [&#xe943]

­

.icon-strategy [&#xe945]

­

.icon-tabs [&#xe947]

­

.icon-target [&#xe949]

­

.icon-upload [&#xe94b]

­

.icon-users [&#xe94d]

­

.icon-video [&#xe94f]

­

.icon-wordpress [&#xe951]

­

.icon-brain [&#xe953]

­

.icon-cactus [&#xe955]

­

.icon-list [&#xe957]

­

.icon-switches [&#xe959]

­

.icon-focus [&#xe95b]

­

.icon-magic [&#xe95d]

­

.icon-user-search [&#xe95f]

­

.icon-rating [&#xe961]

­

.icon-truck [&#xe963]

Get Divi Icons PRO today!

We have a sweet deal for you! You can get the best icon plugin for Divi with a 10% discount! Use the coupon code DIVIICONS10 at checkout!

2 Comments

  1. dieter

    Does not work at all with latest divi

    Reply
    • Maciej Ekstedt

      Sorry to hear that, but you must be doing something wrong. Enqueueing icon fonts method has not changed and Divi version has nothing to do here. See demo below this post. It works all just fine and we are using latest Divi and WP on our site.
      Please follow this tutorial carefully, step by step.

      Reply

Leave a Reply to dieter Cancel reply

Your email address will not be published. Required fields are marked *

Sign up to our newsletter list

Pin It on Pinterest

This site uses Cookies to improve your online experience. By continuing to use this site without changing your cookie preferences we will assume that you are agreeing to our use of cookies. For more information visit ourPrivacy Policy.
Understood