由于某些原因,当我从 iphone 或移动设备上查看时,我的媒体查询无法正确调整我的网站大小,我在 iphone 上获得了该网站的平板电脑版本。媒体查询在平板电脑上运行良好,在缩小浏览器窗口时也能完美运行。
我错过了什么吗?
@media only screen and (min-width: 1024px) {
/*styling here*/
}
@media only screen and (max-width: 1023px) and (min-width: 740px) {
/*Tablet styling here*/
}
@media only screen and (max-width: 739px) and (min-width: 0px) {
/*Mobile styling here*/
}
最佳答案
查看 this , 让我知道它是否有效
您需要指定设备宽度。
关于html - 媒体查询 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11561035/