zoukankan      html  css  js  c++  java
  • 获得手机端的屏幕宽高

    document.documentElement.clientWidth; (用这个看手机做适配的宽高)
    document.documentElement.clientHeight;

    window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
    height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
     
    网页可见区域宽: document.body.clientWidth

    网页可见区域高: document.body.clientHeight

    网页可见区域宽: document.body.offsetWidth (包括边线的宽)

    网页可见区域高: document.body.offsetHeight (包括边线的高)

    网页正文全文宽: document.body.scrollWidth

    网页正文全文高: document.body.scrollHeight

    网页被卷去的高: document.body.scrollTop

    网页被卷去的左: document.body.scrollLeft

    网页正文部分上: window.screenTop

    网页正文部分左: window.screenLeft

    屏幕分辨率的高: window.screen.height

    屏幕分辨率的宽: window.screen.width

    屏幕可用工作区高度: window.screen.availHeight

    屏幕可用工作区宽度: window.screen.availWidth
     

    手机屏幕尺寸如下:

    320

    360

    375

    384

    400

    412

    414

    424

    480

    600

    再大就是平板了

    最小的屏幕宽度就是320,比如iphone4、iphone5和很多小屏幕安卓手机

    最大的就是600了,但是一般为了计算方便,都是假设最大屏幕是640(也有用720的)。

    然后媒体查询结合rem,就能做出来很好看,

  • 相关阅读:
    微信小程序之相对位置
    SQL中 in 、not in 、exists、not exists 用法和差别
    指令打印程序(通过Socket)
    javaee正则表达式基础和常用表达式
    分析JSON/XML
    Hello2 source analisis(代码分析)
    Analysis Of HTTP
    Servlet Filter详细讲
    Analysis of Web.xml in Hello1 project
    Java annotation (注解)
  • 原文地址:https://www.cnblogs.com/sunnie-cc/p/6722649.html
Copyright © 2011-2022 走看看