div宽度怎么自适应
发布网友
发布时间:2022-04-20 11:35
我来回答
共1个回答
热心网友
时间:2022-04-20 13:04
div宽度怎么自适应
<!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>www.zishu.cn</title>
<style>
<!--
html {_padding-top:100px;}
html,body { height:100%; overflow:hidden;}
body{margin:0;padding:0; list-style:none;}
#header{
position:absolute; top:0;
width:100%;
height:100px;
background-color:#0CF;
}
#left {
position:absolute; top:100px; right:auto; left:0; bottom:0;
width:200px;
overflow:auto;
_height:100%;
background-color:#9C0;
}
#middle {
position:absolute; top:100px; right:auto; left:200px; bottom:0;
width:500px;
overflow:auto;
_height:100%;
background-color:#999;
}
-->
</style>
</head>
<body>
<div id="header">header</div>
<div id="left">
<table style="border:1px solid #F00; height:100%; width:100%">
<tr>
<td>
left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />leftleft<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />left<br />leftleft<br />left<br />left<br />
</td>
</tr>
</table>
</div>
<div id="middle">
middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middlemiddle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middlemiddle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />
</div>
</body>
</html>