左侧宽度固定,右侧宽度自适应的方法

<!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" />
<style type="text/css">
#left{
float:left;
width:252px;
text-align:center;
border:1px solid #000;
}
#right{
margin-left:252px;
text-align:center;
border:1px solid #f00
}
</style>
<title>无标题文档</title>
</head>
<body>
    <div id="left">
        固定252px
    </div>
    <div id="right">
        按浏览器自适应
    </div>
</body>
</html>

  

posted @ 2012-11-08 15:27  wushang1987  阅读(137)  评论(0编辑  收藏  举报