Jump to content

[Share] Add Phone/Email/Address Icon before Text

Recommended Posts

Some useful code to add icons before text like this.

image.png.92cc72ff9041be81ea4d3ef72bc3929c.png

If you can't make it work, you can send link to page where you added Text Block, I will check again.

#1. Suppose we have 3 texts like this. Make sure each line is a Paragraph. Do not use Shift-Enter to create the break.

image.png.f4d5a229b264f253179759455ded5f24.png

If you want to remove space between paragraph lines, we will use code in last step

#2. Find ID of Text Block

In my example, we will have:

#block-yui_3_17_2_1_1719906734967_2500

image.png.707e0f496f6a18b6a0cf9a53ead36731.png

#3. Use this line to Code Injection Header. If the site doesn’t support Code Injection, you can add it via Code Block.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />

image.png.9316a0eebd6008a45bce87b18a8c726f.png

#4. Visit FontAwesome website to find the Phone, Email, and Address Icon.

image.png.e158f778662d7ad6507932507504284f.png

Next, click Free then click a desired icon

image.png.8ecf88d58334748d14625f5d92162364.png

and save this text

image.png.1157aa7ee208e222eb305688c5efb953.png

#5. After you have found all 3 icons, you can use this code to Custom CSS box

div#block-yui_3_17_2_1_1719906734967_2500 {
/* Address */
p:nth-child(1):before {
    content: "\f3c5";
    font-family: "Font Awesome 6 Free";
    font-weight: bold;
    font-size: 28px;
    margin-right: 5px;
}
/* Phone */
p:nth-child(2):before {
    content: "\f095";
    font-family: "Font Awesome 6 Free";
    font-weight: bold;
    font-size: 28px;
    margin-right: 5px;
}
/* Email */
p:nth-child(3):before {
    content: "\f0e0";
    font-family: "Font Awesome 6 Free";
    font-weight: bold;
    font-size: 28px;
    margin-right: 5px;
}}

image.thumb.png.0d2f0b0ffc3c06828f30d727e76fa96b.png

Result

image.png.92cc72ff9041be81ea4d3ef72bc3929c.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • Replies 0
  • Views 664
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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.