将100%的高度设置为Twitter Bootstrap中的列 [英] Setting 100% height to columns in Twitter Bootstrap

查看:85
本文介绍了将100%的高度设置为Twitter Bootstrap中的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的BootStrap所以学习绳索和理解它。我试图达到100%的高度在列网格,以便它覆盖页面的100%的高度。现在没有高度设置。当我尝试以像素或%指定col-lg-9和col-lg-3这两列的高度时,不会发生变化。不知道可能是什么问题。
这是我使用的基本结构

I am new to BootStrap so learning the ropes and understanding it. I am trying to acheive 100% height in column grid so that it covers 100% height of the page. Right now no height is set. When I try to specify the height of both columns col-lg-9 and col-lg-3 in pixels or % no change occurs. Don't know what might be the problem. Here is the basic structure I am using

<body>
<div class="row">
"Top bar"
</div>
 <div class="container">
       <div class="row">
        <div class="col-lg-3">
side bar
</div>

 <div class="col-lg-9">
side bar
</div>

</div>

这里是每个项目的css

And here is the css for each item

@media (min-width: 1200px)
.container {
max-width: 1170px;
}
.row {
margin-bottom: 20px;
}
.col-lg-9 {
width: 75%;
padding: 10px 20px;
border-radius: 0 10px 10px 0;
-moz-border-radius: 0 10px 10px 0;
-webkit-border-radius: 0 10px 10px 0;
-o-border-radius: 0 10px 10px 0;
border: 0 none;
padding-top: 3%;
min-height: 90%;
}
.col-lg-3 {
width: 25%;
background-color: #192D38;
color: #88A7A9;
min-height: 90%;
}


推荐答案

>

try this:

html,body
{
  height: 100%;
}

如果不起作用,请使用inspect元素,元素具有100%的高度。 (因为如果他们没有 - 那么子元素将不会获得100%的高度,除非它们 position:absolute position:fixed

If that doesn't work, then use inspect element, and verify that parent elements have 100% height. (Because if they don't - then child elements won't get 100% height unless they are position:absolute or position:fixed

这篇关于将100%的高度设置为Twitter Bootstrap中的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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