0

I'll make it simple:

This is the only code in my sample project's entire scope that turns the background to red.

@media only screen and (min-width: 768px) and (orientation: portrait) {
        background: red;    
    }

I cannot explain why I'm seeing a red background in this Chrome responsive simulator when the min-width is clearly below 768px:

enter image description here

JasonGenX
  • 4,952
  • 27
  • 106
  • 198

2 Answers2

2

I can't replicate the issue. Given you said it is the only code, shouldn't there be a CSS class selector?

@media only screen and (min-width: 768px) and (orientation: portrait) {
    .someClassName {
      background: red;    
    }
}
John
  • 3,716
  • 2
  • 19
  • 21
-1

The answer is that I was using min-width instead of using min-device-height -- Once I switched to device-height vs. height - things started working.

JasonGenX
  • 4,952
  • 27
  • 106
  • 198
  • Regarding device-height - See: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/device-height – John Jun 29 '19 at 00:41