+ -
当前位置:首页 → 问答吧 → 布局自适应问题

布局自适应问题

时间:2010-09-25

来源:互联网


<!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"> <!-- body {margin:10px auto;padding:0;font-size:12px;font-family:Arial, Helvetica, sans-serif;} .read_t {width:950px;min-height:522px;height:auto !important;height:522px;overflow:visible;border:1px solid #bbd4e3;margin:0 auto;padding:0;} .read_t:after {visibility: hidden;display: block;font-size: 0;content: " ";clear: both;height: 0;} .read_t {*zoom:1;} .read_l {width:160px;background:red;float:left;padding-top:8px;} .read_r {width:769px;padding:5px 10px;background:#ccc;float:left;min-height:522px;height:auto !important;height:522px;overflow:visible;} </style> </head> <body> <div class="read_t"> <div class="read_l"></div> <div class="read_r"></div> </div> </body> </html>
 提示:您可以先修改部分代码再运行
因为read_t设置了min-height,而read_r的高度是根据文章的长度而定的,如何让左侧的高度跟右侧的一样

作者: rainbowbin   发布时间: 2010-09-25

只能左侧包含右侧的 左侧的高度才能和右侧的同时变化,设置样式的时候就不能这么设置了,比如线就只能设置左侧的右边线,单独设置样式。可以试试。

作者: dohaming   发布时间: 2010-09-25