Html 使用asp.net mvc(视图)时,如何对齐左侧的标签?

Html 使用asp.net mvc(视图)时,如何对齐左侧的标签?,html,css,asp.net-mvc,twitter-bootstrap,Html,Css,Asp.net Mvc,Twitter Bootstrap,我在下面有一张表格,我想在左边对齐我的标签,然后在右边对齐texbox。在我看来,我该怎么做?我需要在引导上使用类吗 @Html.ValidationSummary(true, "", new { @class = "text-danger" }) <div class="form-group"> @Htm

我在下面有一张表格,我想在左边对齐我的标签,然后在右边对齐texbox。在我看来,我该怎么做?我需要在引导上使用类吗

@Html.ValidationSummary(true, "", new { @class = "text-danger" })
                            <div class="form-group">
                                @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
                                <div class="col-md-5">
                                    @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
                                    @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
                                </div>
                            </div>
@Html.ValidationSummary(true,“,new{@class=“text danger”})
@LabelFor(model=>model.Title,htmlAttributes:new{@class=“controllabel col-md-2”})
@EditorFor(model=>model.Title,new{htmlAttributes=new{@class=“form control”})
@Html.ValidationMessageFor(model=>model.Title,“,new{@class=“text danger”})

在父元素上尝试表单内联类,或者您可以使用引导的水平表单

非常感谢Mehul,它做了我期待的事情。玩它。Bootstrap在形式上得到了很好的评价。