代码示例:(标识:cssref_media_hide)
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
div.example {
  background-color: yellow;
  padding: 20px;
}

@media screen and (max-width: 600px) {
  div.example {
    display: none;
  }
}
</style>
</head>
<body>

<h2>在不同的屏幕尺寸上隐藏元素</h2>

<div class="example">示例 DIV</div>

<p>请调整浏览器窗口的大小以查看响应效果。如果浏览器宽度小于或等于 600 像素,则隐藏元素。</p>

</body>
</html>
运行结果: