如何在线设置复选框

时间:2018-12-12 14:24:26

标签: razor checkbox

在Stackoverflow上,我找到带有以下标签的复选框的解决方案:

    <div class="checkbox">
        <label>@Html.CheckBoxFor(x => item.IsSelected)&nbsp;@Html.DisplayNameFor(x => item.IsSelected)</label>
    </div>

Also, it's recomended solution on bootstrap but, how to set few checkbox in the same class and to set them in-line...

我尝试了类似的方法,但是,obvios只是垂直设置了复选框...

<div class="checkbox">
        <label>@Html.CheckBoxFor(x => x.Temperature)&nbsp;@Html.DisplayNameFor(x => x.Temperature)</label>
    </div>
    <div class="checkbox">
        <label>@Html.CheckBoxFor(x => x.Pressure)&nbsp;@Html.DisplayNameFor(x => x.Pressure)</label>
    </div>
    <div class="checkbox">
        <label>@Html.CheckBoxFor(x => x.Humidity)&nbsp;@Html.DisplayNameFor(x => x.Humidity)</label>
    </div>
    <div class="checkbox">
        <label>@Html.CheckBoxFor(x => x.TemperatureLocal)&nbsp;@Html.DisplayNameFor(x => x.TemperatureLocal)</label>
    </div>
    <div class="checkbox">
        <label>@Html.CheckBoxFor(x => x.HumidityLocal)&nbsp;@Html.DisplayNameFor(x => x.HumidityLocal)</label>
    </div>
    <div class="checkbox">
        <label>@Html.CheckBoxFor(x => x.CO2)&nbsp;@Html.DisplayNameFor(x => x.CO2)</label>
    </div>
    <div class="checkbox">
        <label>@Html.CheckBoxFor(x => x.Illumination)&nbsp;@Html.DisplayNameFor(x => x.Illumination)</label>
    </div>

0 个答案:

没有答案