How do I place MVC view label and edit fields on the same line?
How I can get the generated view code below to place the editor-field to the right of the editor-label, on the same row? I don't want to mess with the 开发者_如何转开发generated defaults, e.g. remove the divs, as I am still in very early dev and regenerate views quite often.
<div class="editor-label">
<%: Html.LabelFor(model => model.Suburb) %>
</div>
<div class="editor-field">
<%: Html.TextBoxFor(model => model.Suburb) %>
<%: Html.ValidationMessageFor(model => model.Suburb) %>
</div>
You could try floating both the .editor-label and .editor-field divs left, and having the .editor-label clear left
精彩评论