<ScriptType="Text/javascript" >(function(Doc, Win) {var docel = doc.documentelement, resizeevt =' Orientationchange 'InchWindow?' Orientationchange ': ' resize ', Recalc = function () {var clientwidth = docel.clientwidth; if (!clientwidth) return; docEl.style.fontSize = 64 * (clientwidth/640) + ' px ';}; if (!doc.addeventlistener) return; Win.addeventlistener (RESIZEEVT, Recalc , false); Doc.addeventlistener ( ' domcontentloaded ', Recalc, false);}) (document, window); </SCRIPT>
Among them, docEl.style.fontSize = 64 * (clientWidth / 640) + ‘px‘
64 is html
set in font-size
, 640 is psd
the image width, also said if PSD
the design 750px, then this side is 75px
. You can try it, the last html
font size that comes into effect is the same as the font size on the http://m.taobao.com html
.
PS: The first person to answer the question, use your code.
Mobile Web page Font size three