【问题标题】:BootStrap Grid issue with fixed container固定容器的 BootStrap Grid 问题
【发布时间】:2014-02-03 20:57:07
【问题描述】:

我正在使用引导程序组成我的视图,我的视图中有以下代码,the container will be a fixed value of 980pxnavbar should have a width of 242px,但是现在导航栏的宽度是由引导程序自动计算的,宽度为 245px。

有没有办法进行自定义以使导航栏具有 242 像素的固定宽度?

    <div class="row" >
        <div id="navbar" class="col-sm-3  col-lg-3  navbar">             

        </div>
        <div class="col-sm-9  col-lg-9  content">
            content
            <!-- insert nested grid here -->
        </div>          
    </div>      
</div>

【问题讨论】:

  • 不要在导航栏中包含引导类,而是放置您制作的任何自定义类...完成! :)

标签: html css twitter-bootstrap grid width


【解决方案1】:

替换这个:-

<div id="navbar" class="col-sm-3  col-lg-3  navbar">

有了这个:-

<div id="navbar" class="navbar">

.navbar{
width: 242px;
}

【讨论】:

  • 宾果游戏...正是...+1 队友!! :D
  • @NoobEditor 好...你很聪明..! :)
【解决方案2】:

试试这个

<div class="row" >
            <div id="navbar" class="col-sm-3  col-lg-3  navbar" style="width:242px;">             

            </div>
            <div class="col-sm-9  col-lg-9  content">
                content
                <!-- insert nested grid here -->
            </div>          
        </div>      
    </div>

【讨论】:

  • 不知道,但是换班会带来很多问题,因为他使用引导程序。
  • col-lg- 是为Large devices Desktops (≥1200px) 使用的,所以它会导致问题....而且由于 BS 只是 css 的编译而不是框架,你总是可以忽略使用它的类....简单! :)
猜你喜欢
  • 2019-04-21
  • 1970-01-01
  • 1970-01-01
  • 2019-11-13
  • 2018-04-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-05-23
相关资源
最近更新 更多