First, the user adjusts the browser font size, affects the Web page that opens from the browser.
The browser sets the font size, which affects the page that the browser opens. JS can control the user to modify the font size, so that the page is not affected.
(Function (doc, win) {//) the font size (ie doc.documentElement.currentStyle) {var user_webset_font=) of the browser that gets the user's settings in the native method doc.documentelement.currentstyle[' FontSize ']; } else {var user_webset_font=getcomputedstyle (doc.documentelement,false) [' FontSize '];}//After rounding with the default 16px scale factor var xs= Parsefloat (User_webset_font)/16;//sets the font size of the REM JS settings var view_jsset_font,result_font;var docel = doc.documentelement, resizeevt = ' orientationchange ' in window? ' Orientationchange ': ' resize ', Clientwidth,recalc = function () {clientwidth = Docel.clientwidth;if (!clientwidth) Return;if (!doc.addeventlistener) return;if (clientwidth<750) {//Set the font size of REM JS settings view_jsset_font=100 * ( CLIENTWIDTH/750);//The final font size is REM font/factor result_font=view_jsset_font/xs;//set root font Size docEl.style.fontSize = Result_font + ' PX ';} Else{docel.style.fontsize = + ' px ';}}; Win.addeventlistener (Resizeevt, Recalc, False);d Oc.addeventlistener (' domcontentloaded ', Recalc, False);}) (document, window);
Second, the user changes the size of the phone font settings, affecting the Web page opened in the app.
The size of the phone font is set to affect the app's page.
Android can be configured via WebView webview.getsettings (). Settextzoom (100) You can disable zooming and display in hundred percent.
REM layout, when user adjusts phone font size/user adjusts browser font size, layout disorder problem