Stop Firefox DPI Scaling (when Windows setting is at 125%)

后端 未结 5 981
死守一世寂寞
死守一世寂寞 2020-12-08 13:54

I\'m currently making a webpage and testing it in chrome works fine, but in Firefox - it is zoomed in.

This is because my DPI in Windows is set to 125%, and Firefox

5条回答
  •  春和景丽
    2020-12-08 14:44

    You could easily let your website address users with settings at higher zoom levels by including a media query like:

    @media only screen and( -webkit-min-device-pixel-ratio: 1.25 ),
           only screen and(      -o-min-device-pixel-ratio: 5/4 ),
           only screen and( min-resolution: 120dpi ),
           only screen and( min-resolution: 1.25dppx ) {
        body {
            font-size: 1rem;
        }
    } 
    

    See this article for an extended explanation and why the cleaned up solution of the media query is sufficient for a broad browser support: IE9+, Fx3.5+, Opera9.5+, Webkit Browsers Chrome and Safari, both Desktop and Mobile.

提交回复
热议问题