简体   繁体   English

全高固定的左侧边栏实现

[英]Full-height Fixed Left Sidebar implementation

I'm trying to implement the following scenario, using Twitter Bootstrap and Fluid Layout : 我正在尝试使用Twitter Bootstrap和Fluid Layout实现以下方案:

  • Left sidebar (I don't care whether the width is fixed or not) - occupying the WHOLE HEIGHT (no margins at all, like the sidebar in jsfiddle.net ) 左侧边栏 (我不在乎宽度是否固定)-占据整个高度(根本没有边距,就像jsfiddle.net的边栏一样
  • The rightmost part of the content, will occupy the remaining part of the window (fluid) 内容的最右边部分将占据窗口的其余部分(流体)

I've tried setting it up like that, but it definitely doesn't work (there are margins everywhere and the columns definitely don't occupy all of the vertical space ) : 我已经尝试过像这样设置它,但是它绝对不起作用(到处都有边距,并且列肯定不占据所有垂直空间 ):

<div class="container-fluid" style="">
    <div class="row-fluid" style="">
        <div class="span3" style="">
        </div>

        <div class="span9" style='background:#fff;'>
        </div>
    </div>
</div>

Any ideas? 有任何想法吗? How would you go about this? 您将如何处理?

Not totally sure but I think this might work... 不太确定,但我认为这可能有效...

Put height:100% on the html and body elements of your page. 将高度:100%放在页面的html和body元素上。

Then give the element that you want to be the full height of the page a min-height:100% 然后为您要成为页面全高的元素设置最小高度:100%

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM