首页 > 其他 > 详细

Media Queries详细

时间:2014-03-18 00:04:15      阅读:609      评论:0      收藏:0      [点我收藏+]
1
2
@media only screen and (max-device-width: 480px) { //页面最大宽度480px
}
1
<link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="small-device.css" /> //外链式

  

1
2
@media only screen and (min-width:480px) and (max-width : 768px){ //480 < x < 768
}

device-aspect-ratio可以用来适配特定屏幕长宽比的设备,这也是一个很有用的属性,比如,我们的页面想要对长宽比为4:3的普通屏幕定义一种样式,然后对于16:9和16:10的宽屏,定义另一种样式,比如自适应宽度和固定宽度:  

1
2
3
4
5
6
7
8
9
10
11
/* for 4:3 screen */
@media only screen and (device-aspect-ratio:4/3){
}
   
/* for 16:9 and 16:10 screen */
@media only screen and (device-aspect-ratio:16/9) and (device-aspect-ratio:16/10){
}
 
/* for 480px*800px width screen Nexus One和Desire等手机 */
@media only screen and (device-aspect-ratio:5/3){
}

  

  

  

Media Queries详细,布布扣,bubuko.com

Media Queries详细

原文:http://www.cnblogs.com/piercalex/p/3605456.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!