Add Padding-Right in .NET MVC Razor Pages

Viewed 28

After doing some Google searches and reading some StackOverflow answers, I tried adding this code (between the two **s, I intended to make that bold):

<div class="col-md-2 p-0">
                                <input type="checkbox" asp-for="GasForcedAir" name="GasForcedAir" id="gasForcedAir" class="form-check-input" onclick="heatSourceSelectOne(this.id)" **style="padding-right:200px !important;"**/><label>Gas Forced Air</label>
                            </div>

But there's still no space between the checkbox and it's label. Would do you suggest I try instead?

1 Answers

Here is a demo to make checkbox and lable in the same line,and add space between them:

<div class="col-md-2 p-0 white-space:nowrap">
    <input type="checkbox" name="GasForcedAir" id="gasForcedAir" class="form-check-input" onclick="heatSourceSelectOne(this.id)" style="margin-right:20px"   /><label>Gas Forced Air</label>
</div>

result:

enter image description here

Related