在一行中设置2个div

时间:2015-08-04 13:14:03

标签: html css twitter-bootstrap

我试图在一行中制作2个div。以下是示例:https://jsfiddle.net/cu0L469f/

但总是我把它们分别放在一行中,或者它们在一行中连接起来。

<form id="postJob" class="login-form">
            <div class="bro">
                <div class="left4">
<div class="row-fluid clearfix">
                        <div class="col-lg-7 pull-left">
                            <label class="text_7">Full Address</label>
                            <input type="text" id="fromAddress" name="fromAddress" class="input" maxlength="1000"/>
                        </div>
                        <div class="col-lg-4 pull-left">
                            <label class="text_7">Postcode</label>
                            <input type="text" id="fromAddressPostCode" name="fromAddressPostCode" class="input" maxlength="8"/>
                        </div>
                    </div>
                    </div>
                </div>
</form>

1 个答案:

答案 0 :(得分:0)

由于您只使用col-lg课程,并且可能在小屏幕中看到,因此您还应根据需要添加col-mdcol-sm以及col-xs

使用链接查看 more details

<form id="postJob" class="login-form">
  <div class="bro">
    <div class="left4">
      <div class="row-fluid clearfix">
        <div class="col-sm-7">
          <label class="text_7">Full Address</label>
          <input type="text" id="fromAddress" name="fromAddress" class="input" maxlength="1000"/>
        </div>
        <div class="col-sm-5">
          <label class="text_7">Postcode</label>
          <input type="text" id="fromAddressPostCode" name="fromAddressPostCode" class="input" maxlength="8"/>
        </div>
      </div>
    </div>
  </div>
</form>