<!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>DIV自适应宽度</title>
<style type="text/css">
<!--
.L { width:100px; background-color:blue; float:left;}
.R { width:100px; background-color:blue; float:right;}
.M { background-color:red; }
-->
</style>
</head>
<body>
<div style="width:500px;">
<div class="L">left:100px</div>
<div class="R">right:100px</div>
<div class="M">自适应宽度</div>
</div>
</body>
</html>
1.自适应宽度的层不要指定宽度和float属性
2.自适应宽度的层物理的位置放在最下面
DIV自适应高度
标签:DIV



