我想让
这是我的jsFiddle链接: http://jsfiddle.net/8vh6M/ CSS:
#sidebar
与#main
的高度相等(并匹配#content
的高度)。我该怎么做?这是我的jsFiddle链接: http://jsfiddle.net/8vh6M/ CSS:
#main {
border: solid green 2px;
}
#sidebar {
background-color: red;
width: 20%;
overflow: auto;
float: left;
height: 100%;
}
#content {
background-color: orange;
width: 80%;
overflow: auto;
float: left;
height: 100%;
}
#main-footer {
clear: both;
}
还有HTML:
<div id="main">
<div id="sidebar">
<ul>
<li>abc</li>
<li>def</li>
</ul>
</div>
<div id="content">
defsdfasdfasd fjasd;lf jasdl;fkjasd; lfjas; lfkjadsfl;sdajfs dlfjsdlfksjflaskfjsdaljfasdl asdfsad sfljsf sadfjsldfj sakfj;alsdfj dfsjsadfl;j asdlfjl;asdfj
defsdfasdfasd fjasd;lf jasdl;fkjasd; lfjas; lfkjadsfl;sdajfs dlfjsdlfksjflaskfjsdaljfasdl asdfsad sfljsf sadfjsldfj sakfj;alsdfj dfsjsadfl;j asdlfjl;asdfj
</div>
<div id="main-footer">
</div>
</div>