<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style>div{ width:50px; height:50px; background:red; border:1px solid #000; font-size:30px; position:absolute;top:0;left:0; text-align:center; line-height:50px; color:#fff;}</style><script>window.onload = function(){ var aDiv = document.getElementsByTagName('div'); for(var i=0; i<100; i++){ document.body.innerHTML+= '<div>'+i+'</div>'} for(var j=1; j<=aDiv.length/10; j++){ for( var i=0; i<aDiv.length; i++){ aDiv[i].style.left=i*60+'px'; if( i==j*10){ aDiv[i].style.top=j*60+'px'; aDiv[i].style.left=j*60+'px'; }; }; };};</script></head><body></body></html>
添加回答
举报
0/150
提交
取消