CSS Media Query – Soft-keyboard breaks css orientation rules – alternative solution?

I know this is a couple of years late but I found a great solution

For landscape media:

@media screen and (min-aspect-ratio: 13/9) { /* landscape styles here */}

And for portrait media:

@media screen and (max-aspect-ratio: 13/9) { /* portrait styles here */}

The full solution and why it works can be found here Michael Barret – Android browser challenges

Edit: this link is now expired, but a snapshot can be found on the internet archive: Michael Barret – Android browser challenges

Leave a Comment