响应式布局(待完善)

来源:互联网 发布:mac安装flash player 编辑:程序博客网 时间:2024/06/05 11:03

响应式布局适合一些比较简单的页面,交互较少的可以使用响应布局实现不同分辨率下页面的不同显示,但是如果页面功能太过复杂,建议不用响应式布局。
如果是手机端和pc端的布局非常不一样,建议可分别引用不同的样式表:
<!--[if lt IE 9]><script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script> <![endif]-->//针对不支持媒体查询的浏览器
<link rel="stylesheet" type="text/css" media="only screen and (max-width:716px)" href="css/style_wap.min.css">//手机端的样式
<link rel="stylesheet" type="text/css" media="only screen and (min-width:716px)" href="css/style.min.css">//pc端的样式


对于手机端不同分辨率的手机又要分别设置
在手机端加载的样式表里:

一边加载全局样式之后,看情况,一般是加在末尾

@media screen and (max-width:319px) {}//主要针对iPhone4以下

@media screen and (min-width: 320px) and (max-width: 374px){}//iPhone4,5

@media screen and (min-width: 375px) and (max-width: 413px){}//iPhone6

@media screen and (min-width: 414px) and (max-width: 600px){}//iPhone6 plus

@media screen and (min-width: 600px){}





0 0
原创粉丝点击