如何在twitter bootstrap中使标签固定大小

时间:2012-07-17 22:49:48

标签: html css twitter-bootstrap

在twitter bootstrap中修复左侧标签的宽度和高度以将其用作固定大小的导航栏的最佳方法是什么?问题在下面的代码中有更好的说明。

      <div class="tabbable tabs-left">
        <ul class="nav nav-tabs">
          <li class="nav-header">Questions</li>
          <li class=""><a data-toggle="tab" href="#lA">------ Question 1 -------</a></li>
          <li class="active"><a data-toggle="tab" href="#lB">------ Question 2 ------</a></li>
        </ul>
        <div class="tab-content">
          <div id="lA" class="tab-pane">
            <p>How do I fix the width of this section as to avoid using the --------</p>
          </div>
          <div id="lB" class="tab-pane active">
            <p>Can I fix the height as well?</p>
          </div>
        </div>
      </div>

1 个答案:

答案 0 :(得分:2)

我对Bootstrap并不是很熟悉,但是没有其他人回答,这里就是......

由于你突出显示的两个元素都有ID,为什么你只能给它们特定的宽度/高度?

#1A {
    width: 300px;
}

#1B {
    height: 30px;
}

正如我所说,我不熟悉Bootstrap所以我可能会误解你的问题,但这对我来说似乎是一个简单的解决方案。