我的媒体查询是这样写的:
@media only screen and (max-device-width: 600px) and (orientation: portrait) {
.img-responsive{
height : 200px;
width : 100px;
}
}
@media only screen and (max-device-width: 600px) and (orientation: landscape) {
.img-responsive{
width : 95px;
height : 100px;
}
}纵向效果很好,但对于横向效果,css似乎不适用。
发布于 2018-06-29 17:31:07
交换解决方案对我有效,尽管我只在chrome上测试过。
@media all and (max-width: 768px) and (max-height: 1024px) and (orientation:portrait) {}
@media all and (max-width: 1024px) and (max-height: 768px) and (orientation:landscape) {}发布于 2021-03-11 15:02:07
我刚刚遇到了一个问题,我想它是一样的……当你用inspect移动模拟器检查你的应用程序时,在顶部栏上有一个缩放选项。如果缩放值小于100%,为什么CSS不将方向视为横向,而忽略@media的所有CSS (我认为这是浏览器的问题)。Chrome和Opera都有缩放选项,在这两种浏览器上,你都有相同的问题(Firefox除外)。
因此有两种选择:
https://stackoverflow.com/questions/41086610
复制相似问题