0

I am working on a website which is working normally on 100% zoom level.

but in some windows laptops the recomended zoom level 150%, so website is zoomed and some sections overlapping in 150%.

however when we change the zoom level to 100% in windows settings website looks normal.

  1. could anyone tell the right approach to handle this issue ?

  2. Is there any way yto target and change windows zoom level to 100% ?

famo
  • 160
  • 1
  • 13

1 Answers1

1

You can use

window.devicePixelRatio 

to detect odd zoom percentages. Here's a link to where someone asked a similar question. I'm not sure where you would go next. Maybe you'd increase the padding by that percentage or something

EDIT: Person in the link said this worked:

document.querySelector("meta[name=viewport]").setAttribute('content', 'width=device-width, initial-scale='+(1/window.devicePixelRatio)+', maximum-scale=1.0, user-scalable=0')
PhantomSpooks
  • 2,877
  • 2
  • 8
  • 13