【发布时间】:2020-03-17 15:02:26
【问题描述】:
我已经搜索了论坛并尝试了许多选项,但我仍然无法使其正常工作。 如前所述,我试图将我的标签和复选框放在同一行。
HTML
<div class="row">
<div class="col">
<div class="editor">
@Html.LabelFor(model => model.Gen_Print_Due_Before_Run)
@Html.CheckBoxFor(model => model.Gen_Print_Due_Before_Run)
@Html.ValidationMessageFor(model => model.Gen_Print_Due_Before_Run)
</div>
</div>
</div>
CSS
.row {
overflow: hidden;
padding: 10px;
}
.col {
float: left;
width: 50%
}
.editor label {
float: left;
width: 30px;
text-align: right;
}
.editor input[type="checkbox"] {
width: 80px;
margin: 0 0 0 10px;
}
【问题讨论】:
标签: html css asp.net-mvc alignment