How to enable CSS position: sticky in mobile browsers?
Asked Answered
G

1

16

Added some position: sticky property to my webpage. On Desktop browser work fine but sucks in mobiles.

Guardroom answered 22/7, 2017 at 1:32 Comment(2)
which browser and which version are you testing?Golanka
Safari ios10 and chrome for iosGuardroom
G
30

sticky property for Chrome and Safari for iOS needs to be set with -webkit vendor first:

.element {
  position: -webkit-sticky;
  position: sticky;
}

You can check about browser compatibility in canIUse

Golanka answered 22/7, 2017 at 4:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.