代码如下:
<div class="form-group">
@Html.LabelFor(model => model.Zapremina_motora, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
<div class="input-group">
@Html.EditorFor(model => model.Zapremina_motora, new { htmlAttributes = new { @class = "form-control" } })
<span class="input-group-addon">cc</span>
</div>
@Html.ValidationMessageFor(model => model.Zapremina_motora, "", new { @class = "text-danger" })
</div>
</div>
我遇到的问题是浏览器为我提供了文本框和跨区插件,其中“cc”文本已分隔。添加了问题的照片。
有人可以帮忙吗?我花了很多时间来解决这个问题,但找不到解决方案。
问题图片:
答案 0 :(得分:0)
尝试用此
替换行@Html.EditorFor(model => model.Zapremina_motora, new { htmlAttributes = new { @class = "form-control", aria-describedby="addon1" } })
<span class="input-group-addon" id="addon1">cc</span>