<h1>網頁標題H1背景色是黃色</h1>
<h2>網頁副標H2背景色是米黃色</h2>
<div class="centered">網頁DIV的背景色是白色</div>
html{
  /*設定網頁背景色*/
  background-color: #54A3D8;
  font-family: Microsoft JhengHei;
}
h1{
  /*設定h1背景色為黃色*/
  background-color: #FFDD40;
  font-size:3em;
  text-align: center;
}
h2{
  /*設定h2背景色為米黃*/
  background-color: #FFBB73;
  font-size:2em;
  text-align: center;
}
div{
  /*設定DIV區塊背景色為白色*/
  background-color: #ffffff;
  height: 100px;
  max-width: 800px;
  font-size:16px;
}
.centered {
    margin: 0 auto;
    text-align: center;
    width: 100%;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.