Bootstrap Glyphicon与文本框对齐

时间:2019-04-24 23:12:57

标签: css asp.net twitter-bootstrap twitter-bootstrap-3 webforms

enter image description here我有以下HTML:

<div class="row">
   <div class="col-md-6">
      <div class="form-group">
         <asp:Label runat="server" AssociatedControlID="txtAccountNumber" CssClass="control-label ">10 Digit Account Number</asp:Label>
     <asp:TextBox  onkeyup="isAccountValid();" CssClass="form-control input-sm" placeholder="Please enter your account number" runat="server" ID="txtAccountNumber" />
     <span id="isAccountValid" class="glyphicon glyphicon-ok" style="color: lightgreen;"></span>
      </div>
   </div>
   <div class="col-md-6">
      <div class="form-group">
     <asp:Label runat="server" AssociatedControlID="txtEmail" CssClass="control-label ">Email</asp:Label>
     <asp:TextBox CssClass="form-control input-sm" placeholder="Please enter your email" runat="server" ID="txtEmail" />
      </div>
   </div>
</div>

我很难把glyphicon放在文本框旁边。有什么建议么?我更喜欢纯CSS或Bootstrap类...谢谢!

1 个答案:

答案 0 :(得分:0)

在行div中添加form-inline可以解决问题。

<div class="row form-inline">