【发布时间】:2018-12-16 15:23:42
【问题描述】:
我使用 Visual Studio 2015 创建 asp.net MVC Web 项目,当我创建剃刀视图的 UI 表单时使用 Bootstrap。我想通过使用以下代码来增加 Bootstrap Dropdownlist 的宽度,但是代码不起作用,bootstrap dropdownlist 的宽度可以改变吗?
<div class="form-group">
<div class="col-xs-3 text-right">
<label for ="coordDesc">Coord </label>
</div>
<div class="col-xs-9" id="t1">
@Html.DropDownList("MovieType", new SelectList(ViewBag.MovieType, "Value", "Text"), new { @class = "form-control", style = "width:1200px;" })
</div>
</div>
【问题讨论】:
-
您确定容器是 1200 像素(减去表单控件使用的边距)吗?使用 F12 工具进行验证。
-
是的,我确信,实际上,您可以通过使用我的代码创建一个简单的测试用例来验证它,如果您有不同的结果,请告诉我。谢谢
标签: asp.net-mvc twitter-bootstrap razor