div 叠在一起 给上不同的颜色

<html>
<head>
 <style>
 .one{
  300px;
  height:300px;
  background:red;
  margin:0 auto;
  margin-top:200px;
 }
 .two{
 275px;
 height:275px;
 background:black;

 }
 .three{
 250px;
 height:250px;
 background:yellow;
 
 }
 .four{
 225px;
 height:225px;
 background:green;
 }
 .five{
 200px;
 height:200px;
 background:blue;
 }
 .six{
 175px;
 height:175px;
 background:#333333;
 }
  .seven{
 150px;
 height:150px;
 background:#00FF00;
 }
  .eight{
 125px;
 height:125px;
 background:#1E90FF;
 }
  .nine{
 100px;
 height:100px;
 background:#48D1CC;
 }
  .ten{
 75px;
 height:75px;
 background:#8B0000;
 }
  .Q{
 50px;
 height:50px;
 background:#FF34B3;
 }
  .W{
 25px;
 height:25px;
 background:#CD00CD;
 }
 </style>
</head>
<body>
  <div class="one">
   <div class="two">
    <div class="three">
     <div class="four">
      <div class="five">
       <div class="six">
        <div class="seven">
         <div class="eight">
          <div class="nine">
           <div class="ten">
            <div class="Q">
              <div class="W"></div>
            </div>
          </div>
          </div>
         </div>
        </div>
       </div>
      </div>
     </div> 
    </div>
   </div>
  </div>
</body>
</html>

步骤挺简单 效果挺好看的
原文地址:https://www.cnblogs.com/bingg/p/5406454.html