根据浏览器,自动缩放屏幕(在css已经写好px的情况下) JQuery $("body[class='main_bg']").attr('style',"zoom: "+$(window).width()/$(document).width()+";");