标签:center window 计算 abs type ack for 小练习 meta
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
div { width:50px; height:50px; background:red; position:absolute; top:0; left:0; font-size:30px; text-align:center; line-height:50px; color:#fff; }
</style>
<script>
window.onload = function (){
var aDiv = document.getElementsByTagName(‘div‘);
for( var i=0; i<11; i++ ){
document.body.innerHTML += ‘<div>‘ + i + ‘</div>‘;
}
for( var i=0; i<aDiv.length; i++ ){
aDiv[i].style.left = 10 + i*50 + ‘px‘;
aDiv[i].style.top = 10 + i*50 + ‘px‘;
}
// 逢10 往下一行(小练习)
// 来一个小V字形(小练习)
};
</script>
</head>
<body>
</body>
</html>
标签:center window 计算 abs type ack for 小练习 meta
原文地址:http://www.cnblogs.com/zhousha929-/p/6907600.html