zoukankan      html  css  js  c++  java
  • 移动端样式处理


    针对不同devicePixelRatio下1px边框实现

    /* 移动端1px边框解决方案 */
    .border-1px:after{
    	content: ' ';
    	display: block;
    	pointer-events: none; /* 防止点击触发 */
        box-sizing: border-box;
    	position: absolute;
    	left: 0;
    	bottom: 0;
    	 100%;
    	border-top:1px rgba(7,17,27,0.1) solid;
    }
    @media screen and (-webkit-min-device-pixel-ratio:1.5),(min-device-pixel-ratio:1.5){
    	.border-1px:after{
    		transform:scaleY(0.7);
    		-webkit-transform:scaleY(0.7);
    	}
    }
    @media screen and (-webkit-min-device-pixel-ratio:2),(min-device-pixel-ratio:2){
    	.border-1px:after{
    		transform:scaleY(0.5);
    		-webkit-transform:scaleY(0.5);
    	}
    }
    @media screen and (-webkit-min-device-pixel-ratio:3),(min-device-pixel-ratio:3){
    	.border-1px:after{
    		transform:scaleY(0.333);
    		-webkit-transform:scaleY(0.333);
    	}
    }
    
    

    多分辨率下的尺寸统一

    使用640宽度的为原型图

    /* 统一多分辨率 640下1rem=10px */
    @media only screen and (max- 1080px), only screen and (max-device-1080px) {
     html,body {
     font-size:16.875px;
     }
     }
     @media only screen and (max- 960px), only screen and (max-device-960px) {
     html,body {
     font-size:15px;
     }
     }
     @media only screen and (max- 800px), only screen and (max-device-800px) {
     html,body {
     font-size:12.5px;
     }
     }
     @media only screen and (max- 720px), only screen and (max-device-720px) {
     html,body {
     font-size:11.25px;
     }
     }
     @media only screen and (max- 640px), only screen and (max-device-640px) {
     html,body {
     font-size:10px;
     }
     }
     @media only screen and (max- 600px), only screen and (max-device-600px) {
     html,body {
     font-size:9.375px;
     }
     }
     @media only screen and (max- 540px), only screen and (max-device-540px) {
     html,body {
     font-size:8.4375px;
     }
     }
     @media only screen and (max- 480px), only screen and (max-device-480px) {
     html,body {
     font-size:7.5px;
     }
     }
     @media only screen and (max- 414px), only screen and (max-device-414px) {
     html,body {
     font-size:6.46875px;
     }
     }
     @media only screen and (max- 400px), only screen and (max-device-400px) {
     html,body {
     font-size:6.25px;
     }
     }
     @media only screen and (max- 375px), only screen and (max-device-375px) {
     html,body {
     font-size:5.859375px;
     }
     }
     @media only screen and (max- 360px), only screen and (max-device-360px) {
     html,body {
     font-size:5.625px;
     }
     }
     @media only screen and (max- 320px), only screen and (max-device-320px) {
     html,body {
     font-size:5px;
     }
     }
     @media only screen and (max- 240px), only screen and (max-device-240px) {
     html,body {
     font-size:3.75px;
     }
     }
    
  • 相关阅读:
    ●表单元素
    ●HTML网页标签2
    ●数据库的备份
    ●HTML网页标签1
    ●索引、视图、游标
    ●SQL编程
    ●关系数据库基础
    ●常用函数
    ●SQL练习题
    ●SQL高级查询
  • 原文地址:https://www.cnblogs.com/LiangHuang/p/6498507.html
Copyright © 2011-2022 走看看