Media Queries CSS

无人久伴 提交于 2020-01-06 20:08:07

问题


For some reason my media queries do not resize my site correctly when viewing from an iphone or mobile device, i get the tablet version of the site on an iphone. The media queries work fine for tablet and perfectly when shrinking a browser window.

Have I missed anything?

@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*/
}

回答1:


Check Out this, and let me know whether it is working or not

You need to specify device width.




回答2:


I think you may need to specify it as 'min-device-width'.

@media only screen and (max-device-width: 739px) and (min-device-width: 0px) {
    /*Mobile styling here*/
}


来源:https://stackoverflow.com/questions/11561035/media-queries-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!