Jump to content

Floating CTA Button on all Linked pages

Go to solution Solved by sqsp_guru,

Recommended Posts

Please help. I want at CTA button to call our phone number. First I tried setting it up in the Home/Page Settings/Advanced. It worked on that page yesterday, but now the button has disappeared. I also tried entering the code in the Website Tools/Code Injection/Header. Neither is creating the Call button I want to float when scrolling.   Here's the code I used:

<div id="customFloatingButton">
    <a href="tel:5859242060" target="_blank">Call 585-924-2060</a>
</div>

<style>
    #customFloatingButton {
        position: fixed;
        botloatingButton a {
        display: inline-block;
        background-color: #8ACB88;
        color: white;
        padding: 10px 10px;
        text-decoration: none;
        box-shadow: 0px 5px 10px -5px rgba(0,0,0,0.5);
        transition: 200ms;
    }
    #customFloatingButton a:hover {
        transform: scale(1.04);
    }
</style>

Link to comment
  • Replies 13
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Please share the site’s URL with the community. By default, it isn't included in the public post.

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Link to comment

@RuthRTW There is a syntax issue in your Code. 
Below is the updated version of the code. Replace old code with this new one.
<style>
    #customFloatingButton {
        position: fixed;
        bottom: 10px;
        right: 10px;
    }
    #customFloatingButton a {
        display: inline-block;
        background-color: #8ACB88;
        color: white;
        padding: 10px 10px;
        text-decoration: none;
        box-shadow: 0px 5px 10px -5px rgba(0,0,0,0.5);
        transition: all 200ms;
        z-index: 9999;
    }
    #customFloatingButton a:hover {
        transform: scale(1.04);
    }
</style>

Link to comment

@sqsp_guru Thanks for catching syntax error -- can you tell I am new to this? I've attached a screenshot of the updated code in the website header. When I first changed it I saw the button but then when I refreshed, it disappeared again! I tried again to add the corrected code to the header of the home page & still nothing.

 

Pswd:  NewSite#SS24

Floating Button Website Header.jpg

Link to comment
4 hours ago, RuthRTW said:

@sqsp_guru Thanks for catching syntax error -- can you tell I am new to this? I've attached a screenshot of the updated code in the website header. When I first changed it I saw the button but then when I refreshed, it disappeared again! I tried again to add the corrected code to the header of the home page & still nothing.

 

Pswd:  NewSite#SS24

Floating Button Website Header.jpg

Your password is not working. can you double check the password?

Link to comment
  • Solution

@RuthRTW add z-index to #customFloatingButton.

Updated Code Version (Replace this with old one)

<style>
    #customFloatingButton {
        position: fixed;
        bottom: 10px;
        right: 10px;
        z-index: 999;
    }
    #customFloatingButton a {
        display: inline-block;
        background-color: #8ACB88;
        color: white;
        padding: 10px 10px;
        text-decoration: none;
        box-shadow: 0px 5px 10px -5px rgba(0,0,0,0.5);
        transition: 200ms;
    }
    #customFloatingButton a:hover {
        transform: scale(1.04);
    }
</style>

 

Link to comment

I have a similar problem need this image to be fixed and floating on main page and this is the code I am using. unfortunately it becomes massive when I put in code. 

#block-yui_3_17_2_1_1714285676278_6321 {position: absoulute;
  position: fixed;
    bottom: 0;
    right: 0;
    z-index: 999;
    height:"60px";
}

it is supposed to a lot smaller, a lot smaller. 

Screenshot 2024-04-30 at 7.20.00 AM.png

Link to comment
On 4/30/2024 at 9:34 PM, graciad said:

I have a similar problem need this image to be fixed and floating on main page and this is the code I am using. unfortunately it becomes massive when I put in code. 

#block-yui_3_17_2_1_1714285676278_6321 {position: absoulute;
  position: fixed;
    bottom: 0;
    right: 0;
    z-index: 999;
    height:"60px";
}

it is supposed to a lot smaller, a lot smaller. 

Screenshot 2024-04-30 at 7.20.00 AM.png

Can you share site url? We can check problem easier

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

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.