Home
CSS
CSS MQ Examples
Tryit: Example of using media queries
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"> <style> @media screen and (max-width: 900px) and (min-width: 600px), (min-width: 1100px) { div.example{ font-size: 50px; padding: 50px; border: 8px solid black; background: yellow; } } </style> </head> <body> <h2>Change the appearance of DIV on different screen sizes</h2> <div class="example">Example DIV.</div> <p>When the browser's width is between 600 and 900px OR above 1100px, change the appearance of DIV. <strong>Resize the browser window to see the effect</strong>.</p> </body> </html>