I am trying to create a media query to identify if a screen is landscape or portrait so that I can change the CSS styling when a screen is rotated. Is this possible and how would i do it?
1 Answer
Check out the orientation
feature.
@media screen and (orientation: landscape) {
/* ... */
}
@media screen and (orientation: portrait) {
/* ... */
}
Side note, this question definitely belongs on StackOverflow instead since it's implementation-specific.
-
Thanks for the answer. Works well! Thanks also for guidance on StackOverflow - new to a lot of this so will check it out. Jan 25, 2021 at 11:53