0
我有一个任务是建立一个边栏,其高度等于内容。 内容越多,侧边栏就越大。如何使边栏高度取决于内容高度?
实际上,我的侧栏等于窗口大小,而不是内容。如果我向下滚动页面,则没有侧栏。
这是我的代码:
HTML:
<div class = "container" style = "height :100%">
<div class = "row" style = "height:100%">
<div class = "col-md-3 hidden-xs hidden-sm" style = "height:100%">
<div class = "sidebar">
.........
</div>
</div>
</div>
</div>
CSS:
html .sidebar,
body .sidebar {
height: 100%;
width: 100%;
background: black;
}
为什么?怎么做才能使它工作?
太感谢你了)一切正常) – Aleks339
不用担心,请接受作为正确答案@ Aleks339 :) – tallent123