开发者

How do I place MVC view label and edit fields on the same line?

开发者 https://www.devze.com 2023-01-06 00:16 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消