Recent write mobile discovery, when I use REM to give HTML root elements a specified scale value, but will be WebView's built-in browse to add a layer of filtering to enlarge its value
Will eventually affect the REM layout. Finally on the internet for a long time an article written font boosting and my situation is very similar. Https://github.com/jin5354/404forest/issues/33.
So he solved it according to his plan, but it didn't work.
$ (function () {
$ (window). Resize (infinite);
function Infinite () {
var $html = $ (' html ');
var htmlwidth = $html. Width ();
var html_fontsize = 28.8/720 * htmlwidth;
$html. CSS ({
"Font-size": 28.8/720 * htmlwidth + "px"
});
if (html_fontsize = = parseint (getComputedStyle ($html [0]). FontSize)) {
Return
}
else {
var t_fs = html_fontsize/(parseint (getComputedStyle ($html [0]). fontsize)/html_fontsize);
$html. CSS ({
"Font-size": t_fs+ ' px '
});
}
}infinite ();
});
So I wrote a way to find the real fontsize. Write fontsize add to HTML, and then expand the scale according to the browser. In the calculation, you really need to write how many fontsize after zooming in to get the value of the computed you want.
Mobile FontSize is automatically amplified by the browser causing REM-Adaptive problems