如何将引导列内的内容向右或向左移动?

时间:2016-10-01 12:53:22

标签: css twitter-bootstrap alignment contact-form

我创建了一个联系表单,其中(col-md-6)表示消息文本区域的名称,电子邮件和(col-md-6)。但我想知道如何使输入字段对齐并且消息输入字段对齐left.Example ...我希望它看起来像这样。

                     (col-md-6)  (col-md-6)
                           Name  Message
                xxxxxxxxxxxxxxx  xxxxxxxxxxxxxxxxxxxxxxxx
                                 xxxxxxxxxxxxxxxxxxxxxxxx
                          Email  xxxxxxxxxxxxxxxxxxxxxxxx
              xxxxxxxxxxxxxxxxx  xxxxxxxxxxxxxxxxxxxxxxxx

                             <SUBMIT>

当我尝试对齐文本时,只有文本对齐到右边..但不是输入字段。可以有人帮助我。

&#13;
&#13;
<div class="row">

  <div class="col-md-6">

    <div dir='rtl'>
      <label for="senderName">Name<span> * </span> 
      </label>
      <br>
      <input class="form-control" id="senderName" tabindex="1" type="text" name="senderName" required>
    </div>


    <label for="senderNumber">Phone<span> * </span> 
    </label>
    <br>
    <input class="form-control" id="senderNumber" tabindex="2" type="number" name="senderNumber" maxlength="15" minlength="10" required>




    <label for="senderEmail">Email<span> * </span>
    </label>
    <br>
    <input class="form-control" id="senderEmail" tabindex="3" type="email" name="senderEmail" required>


  </div>

  <div class="col-md-6">

    <label for="senderComments"><span class="special">Your Message</span>
    </label>
    <br>
    <textarea class="form-control" id="senderComments" tabindex="4" name="senderComments" rows="6"></textarea>

  </div>
</div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

您可以使用dir属性:

<div dir='rtl'>   //rtl = right to left , dir = direction 

<span>name:</span>
<input type="text">
      .
      .
      .
      .
</div>