how to reproduce :
From :
<div class="form-group">
<label class="control-label col-md-2" for="Name">Name</label>
<div class="col-md-10">
<input name="Name" class="form-control text-box single-line" id="Name" type="text" value="">
</div>
<span class="field-validation-valid text-danger" data-valmsg-replace="true" data-valmsg-for="Name"></span>
</div>
To :
<div class="form-group">
<label class="control-label col-md-2" for="Title">Title2</label>
<div class="col-md-10">
<div class="input-group">
<input name="Title" class="form-control text-box single-line" id="Title" type="text" value="">
<span class="input-group-addon">@</span>
</div>
</div>
</div>
we just put "input" inside a "div" with "class='input-group'" and added an "input-group-addon"
the result is very weird , it looks like this : http://i.imgur.com/ylpYJKh.png
but the correct result is this : http://jsfiddle.net/6t3d9z8e/
is this a bug with ASP.Net MVC 5 default template or what ?
It's interesting bug in interaction between bootstrap css and microsoft default styles.
See in your default css file "Site.css" and remove block after comment Set width on the form input elements since they're 100% wide by default
, where setting max-width
property on inputs.
And if you want to limit your input by size you should do this by bootstrap's col-md-...
classes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With