Site logo

Archived topic

Make button sticky on scroll

2 replies · Started by John on August 15, 2022

Viewing posts 1–3 of 3

Hello team!

I am trying to make a button sticky on scroll so that it moves to top of browser window on scroll/
The button is the fixed button to call the business: https://fusionofbeauty.com
Here is the css I have applied to the button:

.call-now-button {
position: fixed;
z-index: 999;
top: 10%;
right: 0;
width: auto;
background-color: #a3718b!important;
font-size: 16px;
padding: 10px 15px;
border-radius: 10px 0px 0px 10px;
}

The effect is something similar to the one in this tutorial:
https://www.w3schools.com/howto/howto_css_sticky_element.asp

I have been experimenting but cannot figure it out - any chance of some help for this?
Cheers!

Hi John,

Where should the button be at the beginning?

In the position it is in if possible - then as it scrolls up it sticks to the top.
Thank you!

This archived topic is closed to new replies.