css中怎么让中间的宽度随两边的大小而改变

来源:百度知道 编辑:UC知道 时间:2024/06/04 11:00:32
给你一个网站 整的的页面的950 是三栏的了 把旁边两栏设宽 中间不准设宽 要做出的效果是 假如我要把旁边的宽度改小 中间就的变大 把旁边的宽度改大中间就的变小

<!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>3列左右侧固定,中间列自适应居中</title>
<style type="text/css">
body { font-family:Verdana; font-size:14px; margin:0;}
#container {margin:0 auto; width:100%;}
#sidebar { float:left; width:200px; height:500px; background:#9c6;}
#sidebar2 { float:right; width:200px; height:500px; background:#9c6;}
#content { margin:0 205px !important; margin:0 202px; height:500px; background:#ffa;}
</style>
</head>