Jump to content

[Share] Add Phone/Email/Address icon to Text Block

Recommended Posts

I will share some code to add Phone/Email/Address Icons to Text Block, like this screenshot.

image.png.e3698d544eb9f6750224482d0a4aed67.png

If you can't make it work, you can comment below or message me with site url + icon code, I can check easier.

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

If you want to reduce space between lines, we can use code in Last Step.

image.png.1fb0bbc782a00afd0d9e8687509fdf6a.png

#2. Next, we need to find ID of Text Block. You can follow this thread. 

In my example, we will have: #block-yui_3_17_2_1_1719906734967_2500

image.png.facf8f73c9db62e0ad75d959aaf1650b.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.thumb.png.a83a595088d1e58ee5d8c7d77b29c97a.png

#4. Visit FontAwesome at https://fontawesome.com/icons to find Phone, Email, Address Icon.

image.thumb.png.47b5610410cece095a3d4d1570bda01d.png

Next, click Free then click a desired icon

image.thumb.png.22453f848316b742115f98287385513c.png

and save this icon code.

image.png.6b6fd765cf04e170a4bb9369eb3ce2b5.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.2f1e575b755d3fe17a40ced7ccf9a02b.png

#6. Result 

image.png.8ff8b895826dee16d5fc12d79ffb74a9.png

#7. To reduce space between paragraph lines, use this CSS code

div#block-yui_3_17_2_1_1719906734967_2500 p {
  margin-top: 2px !important;
  margin-bottom: 2px !important;
}

image.thumb.png.24c395f1b9845cf4466d3f4f5e46bdb8.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 187
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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.