App下載
首頁htmlz_indexCSS Property Value - 如何z-index: 1;

CSS Property Value - 如何z-index: 1;

我們想知道如何z-index: 1;

<!DOCTYPE html>
<html lang="en">
<head>
<style type="text/css">
div {
  top: 30px;
  left: 30px;
  width: 100px;
  height: 100px;
  position: absolute;
}

div.red {
  background: #ff0000;
  z-index: 1;
}

div.green {
  background: #00ff00;
  z-index: 2;
}

div.blue {
  background: #0000ff;
  z-index: 3;
}
</style>
</head>
<body>
  <div class="red">
    <div class="green">
      <div class="blue"></div>
    </div>
  </div>
</body>
</html>