【发布时间】:2017-05-19 17:43:02
【问题描述】:
我正在制作一个使用左右菜单的页面,该菜单应该是位置固定的,中间内容应该是可滚动的,并且应该位于我在 HTML 和 CSS 下方尝试但出现错误的菜单后面。
虽然我给出了正确的菜单位置:固定它的右侧但在位置上:相对它的工作正常。
您的早日回复将不胜感激..
.mainBody {
display: block;
border: 0px solid #000;
max-height: 100%;
min-height: 500px;
position: relative;
}
.sidebar-left {
border: 0 solid #004087;
min-height: auto;
position: fixed;
z-index: 30;
}
.pull-left {
float: left !important;
}
contentright {
margin-left: 0;
width: 200px;
}
.contentrightStyle {
height: 100%;
padding-right: 0 !important;
width: auto;
}
.sidebar-right {
border: 0 solid #004087;
min-height: auto;
position: fixed;
}
.pull-right {
float: right !important;
}
.contentleft {
height: 100%;
padding-left: 23px !important;
width: 200px;
}
.contentleft {
height: 100%;
margin-left: -25px;
width: 266px;
}
<div class="mainBody" style="">
<div id="sidePanelLeft" class="pull-left sidebar-left">
<a class="toggler" data-whois="toggler" id="openerleft" style="">
<i id="toggleImgleft" class="glyphicon glyphiconStyle" style=""></i>
</a>
<div id="contentright" class='visible contentrightStyle' style="">
</div>
</div>
<div id="" class='pull-right sidebar-right' style="">
<a class="toggler" data-whois="toggler" id="opener" style="">
<i id="toggleImg" class="glyphicon glyphiconStyle" style=""></i>
</a>
<div id="contentleft" class='visible contentleftStyle' style="width: auto;">
</div>
</div>
<div class="ScrollableContent">
th tht jjtkj kl jtlktjkler th tht jjtkj
</div>
<div class="clearfix"></div>
</div>
这是供参考的屏幕截图,当我给出位置时,我的右侧菜单与左侧菜单重叠:固定到右侧菜单..
【问题讨论】:
-
我使用左右菜单,为此我对左菜单和右菜单进行位置修复,但右菜单与左菜单重叠,请查看我现在分享的屏幕截图..
-
使用
flex而不是float。float是邪恶的,会让你发疯。
标签: css html twitter-bootstrap-3