<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>移动端--rem案例</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<script src="jquery-1.11.3.min.js"></script>
<script>
$(function(){
//仿淘宝 设置html基值
var scale = 1 / devicePixelRatio;
document.querySelector('meta[name="viewport"]').setAttribute('content','initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no');
document.documentElement.style.fontSize = document.documentElement.clientWidth / 10 + 'px';
});
/* $(function(){
var html = document.documentElement;
var windowWidth = html.clientWidth;
html.style.fontSize = windowWidth / 6.4 + 'px';
var $winW=$(window).width(),$winH=$(window).height(),$root=($winW/6.4).toFixed(0)+"px";
$("html").css("fontSize",$root);
})*/
</script>
<style>
*{margin:0;padding:0;}
html,body{
width:100%;
height:100%;
}
.container{
padding-top:.47rem;
width:9.38rem;
margin:0 auto;
}
h1{
font-size:48px;
color:#fcbe2a;
text-align:center;
margin-bottom:1.16rem;
}
h2{
padding-left:.44rem;
margin-bottom:1.06rem;
font-size:28px;
color:#ee620e;
}
ul,li{
list-style:none;
}
ul{
background:#808080;
}
li{
float:left;
width:2.84rem;
height:2.84rem;
line-height:2.84rem;
margin-right:.42rem;
text-align:center;
font-size:16px;
background:#00ff00;
}
li:last-child{
float:right;
margin:0;
}
.clearfix{
zoom:1;
}
.clearfix:after{
content:".";
display:block;
visibility:hidden;
clear:both;
width:0;
height:0;
}
</style>
</head>
<body>
<div class="container">
<h1>我是大标题</h1>
<h2>我是二标题</h2>
<ul class="clearfix">
<li>模块1</li>
<li>模块2</li>
<li>模块3</li>
</ul>
</div>
</body>
<script> </script>
</html>

最新文章

  1. DBUTIL 调用存储过程例子
  2. 使用Node.JS访问Hyperledger Fabric的gRPC服务
  3. hdu 2232 矩阵 ***
  4. HTTP协议强化理解
  5. IP地址,子网掩码划分(转)
  6. JAVA正则忽略大小写
  7. CP1W-CIF41以太网模块(使用总结)
  8. 【中国剩余定理】 poj 1006
  9. java 中 “文件” 和 “流” 的简单分析
  10. MySql按日期进行统计
  11. CString 转化成 const char* 类型
  12. 优雅地 `async/await`
  13. Gym 102091K The Stream of Corning 2【线段树】
  14. 弹窗中修改select默认值遇到的问题
  15. 《DSP using MATLAB》Problem 6.16
  16. 基于STM32的红外遥控重点解析
  17. 代码操作Word时,目录自动更新的两种方法
  18. [MySQL] 01- Basic sql
  19. 【Phalapi】新加Namespace (模块)
  20. ThinkPHP3.2.3整合smarty模板(三)

热门文章

  1. The Internet Communications Engine (Ice) 跨平台异构通讯方案 第一弹-ICE简介
  2. Shiro - 自定义filterChainDefinitions和Realm
  3. axios发送post请求后台接受不到问题
  4. vue.js开发之开关(switch)组件
  5. springboot伪静态
  6. PHP开发框架CodeIgniter
  7. SZU5
  8. Java 基础 内部类
  9. Maven打包时,不包含jar包
  10. thinkphp session设置