I have a ‘Book Now’ button that sticks to the top of the viewport at 10px gap.
The parent element has height of 100%, which means scrolling past 100%-worth of height makes the ‘Book Now’ div scroll out of view. See here.
How can I make the parent element 100% of the full webpage height, so the ‘Book Now’ div always sticks to the top?
Hi, thanks for this! worked perfectly. I have a new problem, I had to add ‘overflow-x: hidden’ to html, body in order to stop the background video of the site from extending outside of the body. This has now interfered with the sticky div which no longer sticks! Any ideas? edit:
Comment posted by ibb.co/98FwSTp
Hello. Remove
Comment posted by Jack Scott
Hi, thanks for the reply, this solves the position sticky but interferes with the background video! it still lets you scroll horizontally which I’m trying to fix
Comment posted by s.kuznetsov
It worked for me and the video did not go beyond the window. Ok. I’m very busy right now, but as soon as the time comes, I’ll look at the site again.
Comment posted by Jack Scott
Hiya, yeah it works perfectly in Chrome, the problem is specific to Safari. And I’ve seen another thread on stack overflow with a supposed fix ‘-webkit-position: sticky’ which doesn’t work.