在小程序中直接使用媒体查询功能是不起作用的,即
@
media
screen
and (
max-device-width:320
px)
and (
max-device-height:568
px)
{
.fashiontribeListBtn{
font-size:
18
rpx
;
}
}
如果要针对iphone x做css兼容
需要使用js
//iphonex下的css兼容
wx
.getSystemInfo
({
success
:
function
(res
)
{
if
(res
.model
.toLowerCase
().indexOf
(
'iphone x'
)>-
1
){
that
.setData
({
rankScrollIphonex
:
'rankScrollIphonex'
})
}
},
})