簡體   English   中英

在twitter bootstrap中,側邊欄(面板)的高度為100%

[英]Issue with 100% height for Sidebar (Panel) in twitter bootstrap

當我在twitter bootstrap中使用Sidebar(Panel)時,我遇到了麻煩。 這是側邊欄(面板)的快照。

在此輸入圖像描述

這是我的CSS代碼。

    .sharecartside .content {
    height: 100% !important;
    min-height: 100%;
    padding: 18px 10px 20px 30px;
}
.sharecartside {
    height: 100%;
    margin: 1px 0 0 508px;
}
.sharecartside {
    background: url("../images/bg_sidepannel.png") repeat-y scroll 0 0 transparent;
    float: right;
    margin: 1px 0 0 400px;
    position: absolute;
    width: 300px;
}

任何幫助將不勝感激。 謝謝。

為了使'height:100%'適用於任何HTML元素,其父項應定義高度值。 或者項目將擴展到最近的祖先的高度,並定義高度。

如果元素的所有祖先都沒有以百分比定義或定義高度,那么為了使元素擴展到頁面的高度,您應該為'body'和'html'賦予100%的高度。

如果您使用bootstrap響應,請使用

   html,body{ height:100%}

在CSS中應該解決問題。 在包含bootstrap-responsive.css之后,請確保顯示此規則

暫無
暫無

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

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