jquery - 适用于所有设备的 HTML5 应用程序的媒体查询

标签 jquery iphone html css media-queries

任何人都有想法,关于所有媒体查询 这将有助于检测单个设备,例如:

iOS、iPhone 5、iPhone Ratina 显示屏、android 移动设备。 , ipad, 平板电脑 atc ?

最佳答案

寻找media-queries-for-standard-devices

/* Smartphones (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px) {
/* Styles */
}

/* Smartphones (landscape) ----------- */
@media only screen 
and (min-width : 321px) {
/* Styles */
}

/* Smartphones (portrait) ----------- */
@media only screen 
and (max-width : 320px) {
/* Styles */
}

/* iPads (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) {
/* Styles */
}

/* iPads (landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : landscape) {
/* Styles */
}

/* iPads (portrait) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : portrait) {
/* Styles */
}

/* Desktops and laptops ----------- */
@media only screen 
and (min-width : 1224px) {
/* Styles */
}

/* Large screens ----------- */
@media only screen 
and (min-width : 1824px) {
/* Styles */
}

/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
}

用于视网膜显示

@media 
  only screen and (-webkit-min-device-pixel-ratio: 2), 
  only screen and (min-resolution: 192dpi) { 
    /* Retina-specific stuff here */
}

关于jquery - 适用于所有设备的 HTML5 应用程序的媒体查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22374550/

相关文章:

jquery - ajax 调用在 Firefox 和 chrome 中不起作用,但在 IE 中起作用

iphone - 可达性reachabilityWithAddress不起作用

javascript - 如何在 html 上动态添加字段的 javascript 中匹配 id?

html - 更简单的跨浏览器 CSS3 特性

javascript - 页面内链接

JQuery下拉菜单问题

iPhone确实收到内存警告策略

javascript - 使用 jquery mobile 隐藏和显示 div

php - 多个表单输入,如何提交并保存到mysql

iphone - UItextView 文本隐藏