Jump to content

Custom Font Awesome Icons with A tags breaking web page

Go to solution Solved by Ziggy,

Recommended Posts

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

Link to comment
  • Replies 10
  • Views 418
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

  • Solution

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!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment

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!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment

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!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment

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!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment

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.