May*_*rma 3 css3 media-queries landscape-portrait responsive-design
为了确定我正在使用的屏幕尺寸,media queries但我想确定设备是否在,portrait or landscape mode using CSS以便我可以根据屏幕尺寸具有不同的背景图像.
有什么想法吗?
use*_*971 21
只需为横向和纵向模式编写媒体查询:
/* Portrait */
@media screen and (orientation:portrait) {
/* Portrait styles */
}
/* Landscape */
@media screen and (orientation:landscape) {
/* Landscape styles */
}
Run Code Online (Sandbox Code Playgroud)