我正在编写一个Cordova应用程序,需要将这些Google手机隔离以进行样式调整。
考虑到这一点:
我很难区分任何一个Google Pixel手机。
考虑到这一点:
![enter image description here](https://istack.dev59.com/5CTTe.webp)
@media only screen and (min-width: 411px) and (max-width: 731px) {
.myDiv{ background-color: blue; }
}
这会触发所有像素 - 包括模拟器和实际设备
@media only screen and (min-width: 411px) and (-webkit-device-pixel-ratio: 3) {
.myDiv{ background-color: blue; }
}
任何像素手机都无法触发此功能 - 无论是3还是4的像素比例。
@media screen and (device-width: 411px) and (device-height: 731px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2.6){
.myDiv{ background-color: blue;
}
这也不会在任何一款Pixel手机上触发。
我正在努力寻找一个可以隔离Google Pixel 2 XL的媒体查询,但似乎没有任何相关的信息发布,而这款手机已经发布了一段时间了?
有人尝试过吗?