0

Trying to put a checkbox on a razor page and everything is working except the size. I have tried adding html attributes of @style to set width and height. I tried putting it in a div around the checkbox.

  <label for="FluidAbsorbtion" class="col-form-label">Fluid Absorbtion 50 lbs X 2</label>
  <div class="form-control">
      @Html.CheckBoxFor(model => model.FluidAbsorbtion)
  </div>

It just ends up looking like this:

I just need it to be a bit larger. Thanks in advance!

1
  • Hi Steve, which version of asp.net are you using? Commented Feb 21, 2022 at 13:27

1 Answer 1

1

Try: add @style in your @Html.CheckBoxFor()

<label for="FluidAbsorbtion" class="col-form-label">Fluid Absorbtion 50 lbs X 2</label>
  <div class="form-control">
      @Html.CheckBoxFor(model => model.FluidAbsorbtion,new{ @style="width:20px;height:20px;" })
  </div>

result:

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

That worked. I was adding the style wrong. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.