zoukankan      html  css  js  c++  java
  • rem根据屏幕大小适配字体大小

    (function(window, document) {
        function rootSize() {
            var screenWidth = document.documentElement.clientWidth || window.innerWidth;
            //        console.log(screenWidth);
            var rootSize = screenWidth > 750 ? 100 :
                screenWidth < 320 ? 320 / 750 * 100 : screenWidth / 750 * 100;
            document.documentElement.style.fontSize = rootSize + 'px';
        }
        //        window.addEventListener('DOMContentLoaded',rootSize);
        window.onload = function() {
            rootSize();
        };
        window.onresize = function() {
            rootSize();
        }
    })(window, document);
    
  • 相关阅读:
    Properties类
    缓冲流
    Mybatis
    分页查询
    QueryRunner和JDBC连接池
    JSP
    Session
    Cookie
    http协议和eclipes绑定tomcat
    servlet
  • 原文地址:https://www.cnblogs.com/hukeer/p/8471848.html
Copyright © 2011-2022 走看看