媒体查询不起作用,并坚持使用其他媒体查询

时间:2016-03-18 07:56:53

标签: html css iphone media-queries

大家好,我对媒体查询有一些问题。这是我的示例代码

/* Landscape iphone 4 */
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape) {

    /* ----------------- category page  ----------- */
    .block-content > #narrow-by-list2,
    .block-content.stick-up > #narrow-by-list2{
        width: 450px;
    }
}

/* Landscape iphone 6*/
@media only screen
and (min-device-width: 375px)
and (max-device-width: 667px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape) {


    /* ----------------- category page  ----------- */
    .block-content > #narrow-by-list2,
    .block-content.stick-up > #narrow-by-list2{
        width: 637px;
    }

}

当我测试它时,我的div.block-content总是使用iphone 6媒体查询css并且不使用iphone 4媒体查询css.can你告诉我我做错了什么。

之前感谢

0 个答案:

没有答案