2

I have tried to find media query (aspect ratio Media query for nexus 6). but did't find anywhere. if anyone can help me in this matter then let me know.

i also tried to create ratio according to width/height by using this link (http://andrew.hedges.name/experiments/aspect_ratio/) but it's not working for me.

Thanks in advance.

cb4
  • 6,689
  • 7
  • 45
  • 57
Balraj Singh
  • 19
  • 1
  • 4

2 Answers2

0

Someone asking a semi-related question at https://codereview.stackexchange.com/questions/74915/reducing-media-queries seems to have used this:

/* Motorola Nexus 6 (portrait and landscape) */
@media only screen and (min-device-width : 1440px) and
(max-device-width : 2560px) and (-webkit-min-device-pixel-ratio : 3.5) {
html {
    font-size: 200%;
    }
}
Community
  • 1
  • 1
Brian S
  • 1
  • 2
  • i have to find out the media query for nexus 6 according to device aspect ratio not by device width or device pixel ratio. if you have any suggestion for this please suggest me. Thanks. – Balraj Singh Dec 14 '15 at 06:30
0

Since you want the aspect ratio, you just write the dimensions of it like this: @media screen and (device-aspect-ratio: 435/773) { }

Coco
  • 826
  • 1
  • 12
  • 20
  • Thanks for the answer, but please understand the question first. what i want "@media screen and (device-aspect-ratio: 9/16) { }" like that. – Balraj Singh Jul 13 '16 at 11:04
  • Okay, try this: @media screen and (device-aspect-ratio: 435/773) { } Worked for me – Coco Jul 13 '16 at 22:12
  • Okay, I don't know what width and height your device has, but enter those as I did for my values and it should work, because the aspect ratio doesn't change if you have 10/20 or 1/2, in the end it's still the same ratio – Coco Jul 22 '16 at 07:31