Bootstrap v3 - 输入组分开

时间:2015-12-29 00:44:10

标签: asp.net-mvc twitter-bootstrap

我无法将输入组保持为一个部分:

enter image description here

基于使用脚手架的MVC 5模板视图构建我已经构建:

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>Formatos e Planos</h4>
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })

        <div class="form-group">
            @Html.LabelFor(model => model.SizeOpenedWidth, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <div class="input-group">
                    @Html.EditorFor(model => model.SizeOpenedWidth, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.SizeOpenedWidth, "", new { @class = "text-danger" })
                    <div class="input-group-addon">x</div>
                    @Html.EditorFor(model => model.SizeOpenedHeight, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.SizeOpenedHeight, "", new { @class = "text-danger" })
                    <div class="input-group-addon">mm</div>
                </div>
            </div>
        </div>
    </div>
}    

1 个答案:

答案 0 :(得分:1)

当您为所有输入创建新max-width 280px的新MVC项目时,会出现默认css。这就是它搞砸了输入组的原因。

enter image description here

如果您在~/Content/Site.css中删除/对此进行了调整,那么您应该做得很好。