在twitter自举程序中Sidebar(Panel)的100%高度问题 [英] Issue with 100% height for Sidebar (Panel) in twitter bootstrap

查看:262
本文介绍了在twitter自举程序中Sidebar(Panel)的100%高度问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在twitter bootstrap中使用Sidebar(Panel)时,我遇到了麻烦。
此处是Sidebar(Panel)的快照。

I'm in trouble when I use Sidebar (Panel) in twitter bootstrap. Here Is snap of that 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;
}

任何帮助将不胜感激。
谢谢。

Any help will be appreciated. Thank you.

推荐答案

为了使'height:100%'适用于任何HTML元素,项应该定义一个高度值。或者该项将扩展为具有定义的高度的最近祖先的高度。

In order to make 'height:100%' work for any HTML element, its parent item should have a height value defined. Or the item will expand to height of the nearest ancestor with a height defined.

如果元素的所有祖先没有以百分比定义或定义的高度,要让元素展开到页面的高度,你应该给'body'和'html'一个100%的高度。

If all the ancestors of an element have no height defined or defined in percentage, then in order to have the element to expand to the height of the page, you should give both 'body' and 'html' a 100% height.

如果你使用bootstrap响应,使用

If you are using bootstrap responsive, using

   html,body{ height:100%}

在css中应该可以解决问题。请确保此规则在您包括bootstrap-responsive.css

in css should solve the problem. Make sure that this rule appear after you includes bootstrap-responsive.css

这篇关于在twitter自举程序中Sidebar(Panel)的100%高度问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆