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

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

 }
 .three{
 width:250px;
 height:250px;
 background:yellow;
 
 }
 .four{
 width:225px;
 height:225px;
 background:green;
 }
 .five{
 width:200px;
 height:200px;
 background:blue;
 }
 .six{
 width:175px;
 height:175px;
 background:#333333;
 }
  .seven{
 width:150px;
 height:150px;
 background:#00FF00;
 }
  .eight{
 width:125px;
 height:125px;
 background:#1E90FF;
 }
  .nine{
 width:100px;
 height:100px;
 background:#48D1CC;
 }
  .ten{
 width:75px;
 height:75px;
 background:#8B0000;
 }
  .Q{
 width:50px;
 height:50px;
 background:#FF34B3;
 }
  .W{
 width: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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值