如果设备的宽高比较小,我想裁剪图库图像。例如。 iPhone 6,7,8与X。
我的代码中必须存在一些错误,因为这应该是可能的:
/* gallery img should be croped on phones with small height (e.g. iphone 6,7,8, but not X) */
/*@media (max-height: 700px){*/
@media (max-aspect-ratio: 16/9){
#cl_gallery_main{
max-height: 260px;
overflow: hidden;
}
#cl_gallery_main img{
margin-top: -15%;
}
}
最大高度有效,但在iPhone PLUS上,宽高比也为16/9,因此我也要考虑这款手机。
我如何只针对屏幕更高的长宽比?