日期:2014-05-17  浏览次数:20642 次

问下如何让两个浮动元素行高自动相等?
HTML code
<!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" />
<link href="main_style.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" />
<link href="menu.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" />
<title>无标题文档</title>
</head>

<body>


 <div id="mainbox">
         <div id="header"><h1>W3School.com.cn</h1></div>      
      
     <div id="sidebar">
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     <p>"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)</p>
     </div> 
     <div id="content"><h2>Free Web Building Tutorials</h2>
            
            <p>W3School.com.cn - The Largest Web Developers Site On The Net!</p>
            <p>W3School.com.cn - The Largest Web Developers Site On The Net!</p>
            <p>W3School.com.cn - The Largest Web Developers Site On The Net!</p>
            <p>W3School.com.cn - The Largest Web Developers Site On The Net!</p>
            <p>W3School.com.cn - The Largest Web Developers Site On The Net!</p>
            <p>W3School.com.cn - The Largest Web Developers Site On The Net!</p>
            <p>W3School.com.cn - The Largest Web Developers Site On The Net!</p>
      </div>
       <div id="footer">Copyright 2008 by YingKe Investment. </div>    
  </div>
 
</body>
</html>


------解决方案--------------------
楼主参考下

http://www.blueidea.com/tech/web/2006/3210.asp
------解决方案--------------------
自己慢慢设置,设一个值调了看看、、不等在重新设
------解决方案--------------------
#sidebar { float:left; padding:auto; width:445px; background:#F0F; height:540px; overflow:hidden; }

#content { FLOAT: