首页
CSS
CSS MQ 示例
试用:使用媒体查询的示例
运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 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>