3

为了确定我正在使用的屏幕尺寸,media queries但我想确定是否有设备,portrait or landscape mode using CSS以便我可以根据屏幕尺寸拥有不同的背景图像。

有什么想法吗?

4

1 回答 1

25

只需为横向和纵向模式编写媒体查询:

/* Portrait */
@media screen and (orientation:portrait) {
/* Portrait styles */
}
/* Landscape */
@media screen and (orientation:landscape) {
/* Landscape styles */
}

链接在这里

于 2013-10-10T06:50:38.850 回答