簡體   English   中英

如何在同一行上使用Bootstrap樣式對齊三個ASP.NET控件?

[英]How can I align three ASP.NET controls using Bootstrap styles on the same line?

        <div id="search-container">
            <div class="form-inline">
                <asp:DropDownList ID="drpSearchFilter" runat="server" CssClass="form-control">
                    <asp:ListItem>Title</asp:ListItem>
                    <asp:ListItem>Author</asp:ListItem>
                    <asp:ListItem>Keywords</asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox ID="txtSearchBox" CssClass="form-control" runat="server"/>
                <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="btn btn-default" OnClick="btnSearch_Click"/>
            </div>
        </div>

現在,所有這些控件都顯示在單獨的行上。

試試這個(從Bootstrap文檔中 ):

<form class="form-inline">
  <div class="form-group">
    <label for="exampleInputName2">Name</label>
    <input type="text" class="form-control" id="exampleInputName2" placeholder="Jane Doe">
  </div>
  <div class="form-group">
    <label for="exampleInputEmail2">Email</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com">
  </div>
  <button type="submit" class="btn btn-default">Send invitation</button>
</form>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM