关于叠加

1.代码部分:

    

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>Document</title>
 <style type="text/css">
 html{
  height: 100%;
 }
 body{
  position: relative;
  height: 100%;
 }
 .box1{
   50px;
  height: 50px;
  background-color: blue;
  position: absolute;
  right: 10px;
  bottom: 10px;
  margin-bottom: 10px;
 }
 </style>
</head>
<body>
 <button>点击添加元素<tton>
</body>
<ml>
<script type="text/javascript" src="

static/jquery-1.12.3.js”>
<script type="text/javascript">
 i=-1;
$('button').on('click',function(){
 i++;
 
 $('body').append('<div style="bottom:'+i*55+'px" class="box1"></div>');
})
</script>

结果:自己看吧,o(^▽^)o

原文地址:https://www.cnblogs.com/momox/p/6049838.html