Samsung Galaxy S5 media query

浪子不回头ぞ 提交于 2019-12-07 12:14:54

问题


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



来源:https://stackoverflow.com/questions/23644972/samsung-galaxy-s5-media-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!