Samsung Galaxy S5 media query

2019-05-10 11:36发布

问题:

I've done a bit of searching and have tried a few different things, but for the life of me I cannot seem to specifically target the Samsung Galaxy S5. I'm just playing around with a few things while working on a site but nothing I try seems to target the specific device.

Here is what I have tried so far:

@media only screen
(min-resolution: 144dpi)
and (device-width: 1920px)
and (orientation: landscape) {/*styles here*/}

@media screen
(-webkit-min-device-pixel-ratio: 1.5), 
(min-resolution: 144dpi)
and (device-width: 1920px)
and (orientation: landscape) {/*styles here*/}

@media only screen
    (device-width: 1920px)
    and (orientation: landscape) {/*styles here*/}

@media only screen
(min-device-width: 1080px)
and (max-device-width: 1920px)
and (orientation: landscape) {/*styles here*/}

*Note: I've only included "landscape" specific code, but I have tried it without that and with "portrait", but it still doesn't work.

Any help would be greatly appreciated.

回答1:

@media screen and (device-width: 360px) and (device-height: 640px) and (-webkit-device-pixel-ratio: 3)

According to source.

Hope it helps.

Cheers



回答2:

this worked for me...

/* Samsung Galaxy S5 Portrait */    
@media screen(-webkit-min-device-pixel-ratio: 2),(min-resolution: 192dpi)and (device-          width: 1440px)and (orientation: portrait){ 
/*Your styles here */
    html{
  display: none;
  }
}


回答3:

Try using @media screen and (max-width: 680px) and (orientation:landscape) this helped me out alot I also have a samsung galaxy s5