簡體   English   中英

Twitter Bootstrap側邊欄擴展到底部

[英]Twitter Bootstrap sidebar extended to bottom

我正在使用twitter bootstrap,在閱讀堆棧溢出的所有答案后將div擴展到底部我想出了我的側邊欄的代碼。

body

<div id="wrapper-sidebar">
    <div id="content-sidebar" class="text-center">
        <h1> hello</h1>
        <p>welcome to the admin panel</p>
        <p>have a nice stay!</p>
    </div>
</div>

css

#wrapper-sidebar 
{
    margin: 0 auto;
    width: 300px;
    height: 100%;
    padding: 0;
    position: absolute;
}
#content-sidebar 
{
    background-color: #f5f5f5;
    border: 1px solid #e3e3e3;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
     border-radius: 4px;
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
    -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
     box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
     height: 100%;
     padding-top: 5px;
}
.text-center 
{
  text-align: center;
}

現在這確實使側邊欄延伸到我的頁面底部,但它也插入了一個滾動條,當我向下滾動時,我的文字被切斷了。 任何幫助,將不勝感激。 有沒有人知道如何使用bootstrap css類擴展div / sidebar(即height = 100%)?

jfiddle在這里,但它實際上沒有顯示文本被切斷,因此我之前沒有發布。

我相信滾動條是由padding-top和/或border引入的。 您可能需要降低高度以解決這些問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM