[ACCEPTED]-Postfix label text with colon-asp.net-mvc
Accepted answer
Through CSS, you can add the colon via the 3 after
pseudo class. You can find more information 2 about this pseudo class here.
.editor-label > label:after {
content: ": "
}
Working example: http://jsfiddle.net/fJQDZ/
Please note that 1 the after
pseudo class is not available in IE7.
For those who want to avoid using pseudo-elements, an 2 alternative is to keep [Display(Name = "Firstname")]
and use the @Html.DisplayNameFor()
helper 1 with a colon after.
<div><!-- **colon below** ⬇ -->
<div class="editor-label">@Html.DisplayNameFor(x => x.FirstName):</div>
<div class="editor-field">@Html.TextBoxFor(x => x.Firstname)</div>
</div>
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.