
[英]How to make a responsive design for Portrait and landscape mode without adding/removing/editing Design and CSS?
[英]How to determine if a device is in portrait or landscape mode using CSS
为了确定屏幕尺寸我正在使用media queries
但我想确定设备是portrait or landscape mode using CSS
处于portrait or landscape mode using CSS
这样我就可以根据屏幕尺寸拥有不同的背景图像。
有什么想法吗?
只需为横向和纵向模式编写媒体查询:
/* Portrait */
@media screen and (orientation:portrait) {
/* Portrait styles */
}
/* Landscape */
@media screen and (orientation:landscape) {
/* Landscape styles */
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.