【发布时间】:2021-09-16 07:01:54
【问题描述】:
我一直在修改 W3 编辑器以查看媒体查询。我试图理解为什么背景总是蓝色的,除了宽度下限。据我了解,至少有一个特征总是正确的,因此,在反转后,它应该总是黄色的。然而,情况并非如此,仅当视口
有人知道这是为什么吗?
`<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: yellow;
}
@media not screen and (max-width: 600px) , (min-width: 500px) {
body {
background-color: lightblue;
}
}
</style>
</head>
<body>
<h1>The @media Rule</h1>
<p>Resize the browser window. When the width of this document is 600 pixels or less, the background-color is "lightblue", otherwise it is "yellow".</p>
</body>
</html>
`
【问题讨论】:
标签: html css media-queries