html如何改变页面?比如分为上中下三部分,中间又分了两块,怎么让单机中间左面部分改成右面?
<!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=gb2312" />
<title>无标题文档</title>
<style>
.main{ width:800px; height:400px; border:1px solid #999999; border-bottom:none;}
.top,.foot{ width:800px; height:30px; border-bottom:1px solid #999999;}
.center{ width:800px; height:339px;}
.left{ width:200px; float:left;}
.right{ width:600px; float:left; text-align:center; height:330px;}
ul li{ list-style:none; border:1px solid #999999; margin-top:2px;}
</style>
<script>
function showDiv(divid,rows,num){
for(i=1;i<=rows;i++){
document.getElementById(divid+i).style.display="none";
}
document.getElementById(divid+num).style.display="";
}
</script>
</head>
<body>
<div class="main">
<div class="top">这里是头</div>
<div class="center">
<div class="left">
<ul>
<li onclick="showDiv('right_','4','1')">左边一</li>
<li onclick="showDiv('right_','4','2')">左边二</li>
<li onclick="showDiv('right_','4','3')">左边三</li>
<li onclick="showDiv('right_','4','4')">左边四</li>
</ul>
</div>
<div class="right" id="right_1" style="display:">右边一</div>
<div class="right" id="right_2" style="display:none">右边二</div>
<div class="right" id="right_3" style="display:none">右边三</div>
<div class="right" id="right_4" style="display:none">右边四</div>
</div>
<div class="foot">这里是尾</div>
</div>
</body>
</html>