Jump to content

Custom Font Awesome Icons with A tags breaking web page

Go to solution Solved by Ziggy,

Recommended Posts

Posted

I have added custom code to a page of the site in the custom code block and script in the page settings/advanced and everything below that section on the page loses css styling. Screenshot attached, "Ready to Work with us?" should be centered and both buttons should be same size

Code for Page Settings/Advanced: 

<script src="https://kit.fontawesome.com/##########.js" crossorigin="anonymous"></script>

Code Block on page: 

<div style=text-align:center; class="fa-2x">
  <a href="mailto:email@email.com" target="_blank">
<i style=padding:15px; aria-hidden:"true"; class="fa fa-envelope-o"></i></a> 
  <a href="https://www.linkedin.com/" target="_blank">
<i style=padding:15px; aria-hidden:"true"; class="fa fa-linkedin"></i></a>
 <a href="tel:##########">
   <i style=padding:15px; aria-hidden:"true"; class="fa-solid fa-phone center-phone-icon" ></i><a/>
</div> 

 

Screenshot 2023-04-14 at 11.26.19 AM.png

  • Replies 10
  • Views 561
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

  • Solution
Posted

Your inline styles need quote marks around them, the aria-hidden had erroneous semi-colons after and needed an equals instead of a colon, and the final closing </a> had the backslash after the a, here's a corrected version:

<div style="text-align:center;" class="fa-2x">
  <a href="mailto:email@email.com" target="_blank">
    <i style="padding:15px;" aria-hidden="true" class="fa fa-envelope-o"></i>
  </a> 
  <a href="https://www.linkedin.com/" target="_blank">
    <i style="padding:15px;" aria-hidden="true" class="fa fa-linkedin"></i>
  </a>
  <a href="tel:##########">
    <i style="padding:15px;" aria-hidden="true" class="fa-solid fa-phone center-phone-icon"></i>
  </a>
</div>

Can you try that corrected HTML and then let me know if you still have a problem?

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Posted

Can you share your website URL and this page?

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Posted

I don't see why that would be causing these issues, can you remove the code temporarily and send me a screenshot of what it looks like then?

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Posted

@ZiggyIt is working now, not sure what happened. I removed the link for the phone and left icon and page looked fine, then added a tag back and its working now

Posted

Glad it's working, can't see why the phone link would be causing the problem though, coding can be funny that way at times!

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.