css3媒体查询:iPad覆盖iphone4(视网膜)规则

时间:2011-10-26 16:58:57

标签: css css3 safari mobile-safari

似乎iPad规则会覆盖iPhone4相关规则。 我该如何解决这个问题?

/* iPad */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation:portrait) {
    #theDiv { width: 400px; }
}
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation:landscape) {
    #theDiv { width: 600px; }    
}


/* iPhoneRetina */
@media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) {
    #theDiv { width: 200px; }
}

1 个答案:

答案 0 :(得分:1)

您可以将Retina显示像素比率提高到2。

Here's the link to the Webkit blog post about it。转到标题“条件包含”。