Prevent scroll bounce effect and pull-to-refresh on mobile using overscroll-behavior CSS property

preview_player
Показать описание
A quick CSS tip outlining how to easily prevent scroll past the top of the page and pull-to-refresh on mobile by setting `overscroll-behavior: none;` on html and body elements of a page.

Buy my course Mastering Prettier & Stylelint:

Subscribe to CSS Weekly Newsletter:

Keep up-to-date with CSS Weekly:

Keep up to date with what I'm up to:

- Zoran Jambor
#css #frontend
Рекомендации по теме
Комментарии
Автор

THANK YOU VERY MUCH! This has been driving me mad for months now.

I was stuck with complicated solutions until this!

mrvfino
Автор

u just made me the happiest man on the whole planet, i have been searching for this since April 2024, thank u so much for this u just saved my life😂❤❤❤

laith
Автор

Holy sh*t! Thanks for this! Been bugging me for days! Finally fixed!

DarylMalibiran
Автор

Where do i give this css style in the body tag, or root. Or html...Im using next js. I used this in body tag, but still the scroll issue was there..please helpppp

SkaiDex
Автор

It is interesting that this prevents refreshing. I would have totally expected this to need JavaScript, since it affects the functionality of the page.

ScriptRaccoon
Автор

How do I get to "overscroll behavior", please, for laymen? :-)

eddiemattison
Автор

sorry non-tech person here, how do I add or edit this after I inspect element? thanks

bryanatas
Автор

I don’t know if you’ll see this but do you have an idea how I can get the toolbar and address bar to collapse/disappear when I’m scrolling on iOS mobile for a webpage (css or js?)

shilohnjoku