响应式用法rem,需要加入这段JS

<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>

 

posted @ 2019-04-18 18:26  夏小夏吖  阅读(257)  评论(0编辑  收藏  举报