大家好,我说下我的情况。ipad的像素是1024*768,我使用媒体查询@media only screen and (max-width:1024px) {css代码}为何在谷歌浏览器模拟后,css代码正确执行, 而在ipad设备上运行却无效?还是说有其他更好的方法能让一个页面在ipad上浏览的时候,就能适应ipad的宽度?谢谢!
认证0级讲师
Checked it, it was my mistake. It should be solved using min/max-device-width/height.
It is enough to add this sentence, no need for max-device-width/height:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Checked it, it was my mistake. It should be solved using min/max-device-width/height.
It is enough to add this sentence, no need for max-device-width/height: