我正在使用 css 媒体查询来检测 iPad 上的纵向模式并将居中样式应用于具有固定或绝对定位的 div,我都尝试过均无济于事。查询正在运行,但 div 不会以纵向模式居中。它将在风景中完美居中。
您可以在http://goodmorningmoon.ca上实时查看该网站通行证:springy88
这是我的代码
@media only screen and (max-device-width: 1024px) and (orientation:portrait) {
#logo{ position:absolute; left:50%; width:160px; margin-left:80px;}
}
谢谢!提前。