Home
CSS
RWD Media Queries
Tryit: Media query orientation - portrait / landscape
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> body { background-color: lightgreen; } @media only screen and (orientation: landscape) { body { background-color: lightblue; } } </style> </head> <body> <p>Resize the browser window. When the width of this document is larger than the height, the background color is "lightblue", otherwise it is "lightgreen".</p> </body> </html>