我正在尝试垂直#sidebar
填充#main
(并匹配#content
的高度)。我该怎么做呢?
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>