首页htmlmediaCSS Layout - 如何根据屏幕尺寸更改H1字体大小和颜色

CSS Layout - 如何根据屏幕尺寸更改H1字体大小和颜色

我们想知道如何根据屏幕尺寸更改H1字体大小和颜色。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.left {
  width: 32%;
  float: left;
  margin: 5px;
}

@media screen and (max-width: 1024px) {
  h1 {
    font-size: 10px;
    color: blue;
  }
}
</style>
</head>
<body>
  <div class="left">
    <h1>Title</h1>
    <p>Content</p>
  </div>
  ...
  <div class="left">
    <h1>Title Too Long Long</h1>
    <p>Content</p>
  </div>
</body>
</html>