JS:
if(window.devicePixelRatio > 1){ //是retina屏幕 }
CSS:
@media screen and (-webkit-min-device-pixel-ratio: 1.5), screen and (-moz-min-device-pixel-ratio: 1.5) , screen and (-ms-min-device-pixel-ratio: 1.5) , screen and (-o-min-device-pixel-ratio: 1.5) , screen and (min-device-pixel-ratio: 1.5) { .test { /*是retina屏*/ } }