Jump to content

Floating button anchor

Recommended Posts

Site URL: https://eduall.squarespace.com/pravidla

Good morning, 

i created a floating button "Order a webinar", here: https://eduall.squarespace.com/pravidla

But i need to make an anchor and redirect the button to that anchor (at the bottom of the page), so i need make a jump page on the same page. 

 

I probably know how to create an anchor with ID, but i dont know how the code in the floating button redirect to the anchor. 

 

I use this code for the floating button:

<a href="eduall.squarespace.com" class="t-button">Objednat webinář</a>
<style>
  .t-button {
      display: inline-block;
    background: green;
    color: white;
    padding: 1em 2em;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    position: fixed;
    top: 50%;
    right: 0;
  }
</style>

 

and this code for the anchor:

<p id="nameofanchor"></p>

 

Thank you for your help, im trying to make it work last two days 😄

Michal

 

 

 

Link to comment
  • Replies 5
  • Views 305
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

The href is wrong, it's needs to be like this:

href="/page-slug/#anchor-id"

Do not include the Squarespace URL just the but after the .com 

 

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

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

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

Link to comment

Anchor code is fine, you've correctly not added any spaces, though you could use <span> instead of <p> if you're not putting any text. 

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

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

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

Link to comment
html {
  scroll-behavior: smooth;
}

Add this to your Custom CSS. 

 

 

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

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

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

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.