从bootstrap,它只有按钮和下拉列表的组合,如果我想这样
我应该如何写在我看来?
从我看来
<div class="container">
<div class="row form-group">
<div class="input-group">
@Html.DropDownList("dateList", ViewData["dateList"] as IEnumerable<SelectListItem>, new { @id = "dateList", @class = "form-control" })
<input type="text" class="form-control" readonly="readonly" id="DCRDate" name="DCRDate" value="" />
<button id="submitBtn" type="submit" class="btn btn-default">Change</button>
</div>
</div>
</div>
我有这个
与AndréFranciscatoPaggi代码 跨越下拉列表,它变得像
<div class="container">
<div class="row form-group">
<div class="input-group">
<span class="input-group-btn">
@Html.DropDownList("dateList", ViewData["dateList"] as IEnumerable<SelectListItem>, new { @id = "dateList", @class = "form-control" })
</span>
<input type="text" class="form-control" readonly="readonly" id="date" name="date" value="" />
<button id="submitBtn" type="submit" class="btn btn-default">Change</button>
</div>
</div>
</div>
答案 0 :(得分:0)
您可以使用类&#34; input-group-btn&#34;来围绕按钮和带有span标记的选择。
这是一个片段:
#myselect{
width: 80px;
}
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group">
<span class="input-group-btn">
<select name="myselect" id="myselect" class="form-control">
<option selected>Foo</option>
<option>Bar</option>
</select>
</span>
<input type="text" class="form-control" readonly="readonly" id="DCRDate" name="DCRDate" value="Input here" />
<span class="input-group-btn">
<button id="submitBtn" type="submit" class="btn btn-default">Change</button>
</span>
</div>
&#13;