div上下左右都是剧中的 呵呵
代码
<style type="text/css">
body{
margin:0px;
padding:0px;
width:100%;
height:100px;
}
#father{
position:absolute;
top:50%;
left:50%;
margin-top:-250px;
margin-left:-250px;
width:500px;
height:500px;
border:solid 1px red;
}
#sons{
position:absolute;
top:50%;
left:50%;
margin-top:-125px;
margin-left:-125px;
width:250px;
height:250px;
border:solid 1px red;
}
</style>
<body>
<script type="text/javascript">
var str="";
for(var i=500;i>0;i-=10){
str+="<div style=\"padding:2px;;position:absolute;top:50%;left:50%;margin-top:-"+(i/2)+"px;margin-left:-"+(i/2)+"px;width:"+i+"px;height:"+i+"px;border:solid 1px red;\"></div>"
}
document.write(str);
</script>
</body>
</html>