Skip to main content Skip to secondary navigation
New Guide!

Welcome to the Stanford Sites 4.0 User Guide. 

Add Font Awesome icons

Main content start

Accessibility

If your icons have semantic meaning, include this information in the text near the icon. 

Learn more about semantic icons.

Using symbols such as icons to augment the text on your website can improve comprehension and clarify your message.

Your Stanford Sites website supports the use of Font Awesome icons. You can place these in text fields that use HTML text format.

Add Font Awesome icons

  1. Search Font Awesome’s v5 free icon database and choose the icon you want to use, then click Start Using This Icon

  2. Copy the code provided by Font Awesome. This will look something like  class="fa fa-drupal".
  3. In the text area toolbar, click on Source.
  4. Find the text where you want to add the icon. 
  5. Paste the Font Awesome code as a CSS class to the <p>.    
    This will look like <p class="fa fa-drupal”> 
  6. Click Continue (or click on Source to switch back to the WYSIWYG editor to see the icon displayed in the editor).
  7. Scroll down and click Save.

Example

Troubleshooting

After adding an icon and hitting enter, the same icon appears again

In order to continue adding text, you will need to switch to the Source view and remove the class=" " from the <p> tag.

Screenshot fab fa-drupal

Then, type a new paragraph tag <p></p>

Screenshot fab fa-drupal 2

Click on Source to switch back to the text editor. Now you can type in the empty paragraph below the paragraph with the icon.

Code 3

 

I copied the code but it is not working

The code may need some adjustments. Try updating the code similar to this 

<p class="fa fa-solid fa-podcast"> or <p class="fas fa fa-newspaper-o">

My edits disappear

When adding an icon to a <span>, the <span> must have some content or upon saving, the WYSIWYG will remove it assuming it is empty. To fix this, add a <span> tag with a single space:

<span class="fas fa-lock"> </span> 

Given this example:

<p>        
  <a href="https://drive.google.com/file/d/filename">Stanford's TPR proposal </a>        
  (May 2021)        
    <span class="fas fa-lock"> </span>        
</p>

It will look like this:

 Stanford's TPR proposal   (May 2021) 

 

Related Topic