1.获取css外部样式表的属性值
getCss(obj,'属性名称');如:getCss(oSpan[0],'height');
getComputedStyle(obj).属性名称;如:getComputedStyle(oDiv[0]).width;
2响应式布局
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta name="viewport" content="width=320, user-scalable=no, target-densitydpi=device-dpi"> 安卓专属,(私人博客说)将被放弃使用
使用方式,例如:
html{font-size:10px}
@media screen and (min-321px) and (max-375px){html{font-size:11px}}
@media screen and (min-376px) and (max-414px){html{font-size:12px}}
@media screen and (min-415px) and (max-639px){html{font-size:15px}}
@media screen and (min-640px) and (max-719px){html{font-size:20px}}
@media screen and (min-720px) and (max-749px){html{font-size:22.5px}}
@media screen and (min-750px) and (max-799px){html{font-size:23.5px}}
@media screen and (min-800px){html{font-size:25px}}
@media screen 媒体查询
3.图片大小百分比
img background-image background-size
4.布局百分比
width height position margin padding
5.字体大小百分比
em 倍数 是父级字体大小的倍数
rem 倍数 是老祖宗的倍数。