gpt4 book ai didi

javascript - Bootstrap下拉表单宽度

转载 作者:行者123 更新时间:2023-12-02 18:44:50 25 4
gpt4 key购买 nike

我有一个下拉表单,其宽度当前受到激活下拉列表的链接宽度的限制:

the problem

我希望表单能够根据需要扩展,以便将所有表单元素放在一行上。我怎样才能做到这一点?

当前 HTML 代码:

<h1>Time Period:
<div id="date-filter-dropdown" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<span class="primary">May 2013</span></a>
<ul class="dropdown-menu" role="menu">
<li>
<form class="form-inline">
<input type="text" class="input-mini filter-time-form" id="id_filter_form_year" maxlength="4" size="4" placeholder="YYYY" />
<span class="filter-form-date-dividers">&dash;</span>
<input type="text" class="input-mini filter-time-form" id="id_filter_form_month" maxlength="2" size="2" placeholder="MM" />
<span class="filter-form-date-dividers">&dash;</span>
<input type="text" class="input-mini filter-time-form" id="id_filter_form_day" maxlength="2" size="2" placeholder="DD" />

<button type="button" class="btn btn-primary javascript-submit" id="filter-date-submit" onclick="filter_time();">Filter</button>
</form>
</li>
</ul>
</div>
</h1>

JSFiddle

此外,无论出于何种原因,单击表单都会使其立即消失。这不会发生在我正在使用的实际网页上,只会发生在 JSFiddle 页面上。我现在通过按 Tab 绕过了这个问题。

最佳答案

h1 div#date-filter-dropdown ul.dropdown-menu {
white-space:nowrap;
min-width: 10px;
}

关于javascript - Bootstrap下拉表单宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16512517/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com