层自动适应高度 body { font:12px Tahoma;margin:0px;text-align:center; } a:link,a:visited {font-size:12px;text-decoration:none;} a:hover{} /*页面层容器*/ #container { width:780px;margin:0px auto;background:#fff } /*页面头部*/ #header {background:url(logo.gif) no-repeat;} #banner { background:url(banner.jpg) 0px no-repeat; /*加入背景图片*/;background:#999; width:780px; /*设定层的宽度*/ margin:auto; /*层居中*/ height:200px; /*设定高度*/ border-bottom:5px solid #EFEFEF; /*画一条浅灰色实线*/ clear:both /*清除浮动*/ } #pagebody { width:780px; /*设定宽度*/ margin:0px auto; /*居中*/ background:#000 } #sidebar { width:200px; /*设定宽度*/ text-align:left; /*文字左对齐*/ float:left; /*浮动居左*/ background:#f3c;color:#666 overflow:hidden; /*超出宽度部分隐藏*/ height:300px; padding:0px } #mainbody { width:580px; text-align:left; margin:0px auto; /*居中*/ float:right; overflow:hidden; color:#fff } /*页面底部*/ #footer{ width:780px;margin:0 auto;height:65px;background:#999;repeat-x;color:#ff0066;clear:both; } 这一层需要与右边的层同步,也需要自适应高度 想使这一层自动适应高度,有办法吗? 这一层不变 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]