具有静态宽度的Bootstrap form-inline DropDownLists

时间:2015-08-31 20:21:42

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

我有3个DropDownLists,标签互相内联。我试图将所有DropDown的宽度设置为静态200px。相反,bootstrap会覆盖并制作它,因此下拉列表始终是动态内部最宽项目的宽度。

<div class="form-inline">
    <div class="form-group">
        <asp:Label ID="lblDropDownList1" runat="server" Text="DDL 1 Label:" AssociatedControlID="ddlDropDownList1"></asp:Label>
        <telerik:RadDropDownList ID="ddlDropDownList1" runat="server" Width="200px" CssClass="form-control"></telerik:RadDropDownList>
    </div>

    <asp:Panel ID="pnlDropDownList2" runat="server" CssClass="form-group" Visible="false">
        <asp:Label ID="lblDropDownList2" runat="server" Text="DDL 2 Label:" AssociatedControlID="ddlDropDownList2"></asp:Label>
        <telerik:RadDropDownList ID="ddlDropDownList2" runat="server" Width="200px" CssClass="form-control"></telerik:RadDropDownList>
    </asp:Panel>

    <asp:Panel ID="pnlDropDownList3" runat="server" CssClass="form-group" Visible="false">
        <asp:Label ID="lblDropDownList3" runat="server" Text="DDL 3 Label:" AssociatedControlID="ddlDropDownList3"></asp:Label>
        <telerik:RadDropDownList ID="ddlDropDownList3" Width="200px" CssClass="form-control"></telerik:RadDropDownList>
    </asp:Panel>
</div>

1 个答案:

答案 0 :(得分:-1)

制作一个具有设定宽度的容器DIV。然后将下拉的宽度设置为小于该宽度,并且不应超出大小。