Bootstrap 3:Div不像以前那样工作

时间:2013-08-05 18:59:02

标签: html css twitter-bootstrap twitter-bootstrap-3

我的表单中有section divs。每个部分可以有多个字段。它适用于Bootstrap 2.3 css。当我用Bootstrap 3.0 css替换它时,所有字段都来自div部分。我试过检查元素,但找不到任何区别。
CSS

.section {
    position: relative;
    margin: 15px 0;
    padding: 39px 19px 14px;
    background-color: #fff;
    border: 1px solid #649300;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;

}

HTML

<div class="section" name="amount">
        <span class="section-title">Amount Information</span>
          <div class="span6 form-inline">
                <label class="pocLabel">

                Amount Of</label>
                <input type="text" name="amount" required="">
          </div>
          <div class="span6 form-inline">
                <label class="pocLabel">
                Customer First Name</label>
                <input type="text" name="firstName" required="">
          </div>
          <div class="span6 form-inline">
                <label class="pocLabel">

                Customer Last Name</label>
                <input type="text" name="lastName" required="">
          </div>
          <div class="span6 form-inline">
                <label class="pocLabel">

                Middle intials</label>
                <input type="text" name="middleIntials" required="">
          </div>
          <div class="span6 form-inline">
                <label class="pocLabel">

                Date</label>
                <input type="text" id="datepicker" class="datepicker" name="date">
          </div>
          <div class="span6 form-inline">
                <label class="pocLabel">
                Street Address</label>
                <input type="text" name="address">
          </div>
          <div class="span6 form-inline">
                <label class="pocLabel">
                City</label>
                <input type="text" name="city">
          </div>
          <div class="span6 form-inline">
                <label class="pocLabel">
                State</label>
                <input type="text" name="state">
          </div>

          <div class="span6 form-inline">
                <label class="pocLabel">
                State 2</label>
                <input type="text" name="state">
          </div>

      </div>

2 个答案:

答案 0 :(得分:5)

Bootstrap 3已经淘汰了spanX个类。用col-lg-X类替换那些。

请参阅this migration guide from v2.x to v3 of Bootstrap

答案 1 :(得分:0)

尝试关闭输入标记,将其打开可能会导致问题。

实施例:     <input type="text" name="state"></input>

或者:     <input type="text" name="state" />