【发布时间】:2015-06-20 16:58:44
【问题描述】:
我有问题。
我的页面分为左右两部分。 每个部分都有自己的工具栏和工具栏下的内容。
我想让工具栏修复,只有内容滚动。
但是当我制作内容 {overflow:scroll} 时, 太长的内容文本将在 div 之外。
当我制作两个部分{overflow:scroll},两个工具栏{position:fixed}时,工具栏1的宽度将为100%,覆盖工具栏2。
p.s.此页面使用 javascripts。一种是粘性页脚,一种是如果主要内容的文本太短,它的 div 可以随窗口调整大小。
.left {
float: left;
width: 20%;
}
.right {
float: right;
width: 80%;
}
.toolbar1 {
position: fixed;
background-color: red;
}
.toolbar2 {
position: fixed;
background-color: yellow;
}
.scroll {
overflow: scroll;
}
.clear {
clear: both;
}
<div class="left">
<div class="toolbar1">asdfgh</div>
<div class="scroll">1<br>1<br>1<br>1<br>1<br>1<br>1<br></div>
</div>
<div class="right">
<div class="toolbar2">123123</div>
<div class="scroll">1<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br></div>
</div>
<div class="clear"></div>
<footer>footer</footer>
【问题讨论】:
标签: html css scroll overflow toolbar