• 媒体查询 和rem布局


    @media screen and (min- 320px) {html{font-size: 45.66px;}}
    @media screen and (min- 360px) {html{font-size:48px;}}
    @media screen and (min- 375px) {html{font-size:50px;}}
    @media screen and (min- 400px) {html{font-size:53.33px;}}
    @media screen and (min- 414px) {html{font-size:55.19px;}}
    @media screen and (min- 440px) {html{font-size:58.66px;}}
    @media screen and (min- 480px) {html{font-size:64px;}}
    @media screen and (min- 520px) {html{font-size:69.33px;}}
    @media screen and (min- 560px) {html{font-size:74.66px;}}
    @media screen and (min- 600px) {html{font-size:80px;}}
    @media screen and (min- 640px) {html{font-size:85.33px;}}
    @media screen and (min- 680px) {html{font-size:90.66px;}}
    @media screen and (min- 720px) {html{font-size:96px;}}
    @media screen and (min- 760px) {html{font-size:101.33px;}}
    @media screen and (min- 800px) {html{font-size:106.66px;}}
    @media screen and (min- 960px) {html{font-size:128px;}}

    //js动态修改rem


    window.onload = function(){ getRem(750,100) //第一位参数和设计图一样大小 }; window.onresize = function(){ getRem(750,100) }; function getRem(pwidth,prem){ var html = document.getElementsByTagName("html")[0]; var oWidth = document.body.clientWidth || document.documentElement.clientWidth; html.style.fontSize = oWidth/pwidth*prem + "px"; } // 小米官网的写法 // !function(n){ // var e=n.document, // t=e.documentElement, // i=750, // d=i/100, // o="orientationchange"in n?"orientationchange":"resize", // a=function(){ // var n=t.clientWidth||320;n>750&&(n=750); // t.style.fontSize=n/d+"px" // }; // e.addEventListener&&(n.addEventListener(o,a,!1),e.addEventListener("DOMContentLoaded",a,!1)) // }(window);
  • 相关阅读:
    数据库原理学习笔记
    嵌入式SQL
    Oracle ProC编程、嵌入SQL
    配置ORACLE的PRO*C环境
    SQL Server数据库_判断表(库)是否存在
    Dreamweaver连接SQL数据库步骤
    ylmf os 将雨林木风的系统diy定制成自个儿个人的专用系统
    完美解决CSS网页水平居中垂直居中
    《奋斗》经典幽默台词
    WCF 4.0 REST Service JSON跨域调用
  • 原文地址:https://www.cnblogs.com/xm16/p/10413886.html
Copyright © 2020-2023  润新知