<script type="text/javascript"> $(function(){ function size() { winWidth = $(window).width(); if (winWidth < 750) { $("html").css("fontSize", (winWidth / 10).toFixed(1) + "px"); } else { $("html").removeAttr("style"); } } size(); $(window).resize(function () { size(); }); }) </script>