DEV Community

NITIN YADAV
NITIN YADAV

Posted on

Instantly Improve Mobile Usability with This CSS Trick

Want to prevent users from accidentally zooming in on your website? Disable double-tap zoom on mobile devices with this simple meta tag:

Image description

This makes your mobile site feel more like a native app. Have you tried this in your projects?

Top comments (3)

Collapse
 
rouilj profile image
John P. Rouillard
Collapse
 
axi0m profile image
Matt

I would say it really depends on the project you're building. For content-first websites (blog, landing pages, e-commerce, and such), preventing users from zooming in breaks accessibility and provides a bad overall UX, thus it's not a good thing. In other cases (mostly web apps, especially PWA), it can be relevant if you are really trying to apply the look & feel of a native app. But don't expect W3C or Lighthouse to give their blessing on that.

Collapse
 
davidacardona profile image
davidacardona

Lighthouse recommends seeting this to 2x to 3x zoom, because many users need to zoom indeed. Vision impaired users, images with small details, etc.