Checkbox: how to display text?

Instead of using for attribute you can use the nested <input type="checkbox">:

<label><input name="Checkbox1" type="checkbox">Admin User</label>

Instead of using <span> you can use the <label>-tag:

<label for="Checkbox1">Admin User</label>

It will 'attach' the label to your checkbox in a sense that when the label is clicked, it is as if the user clicked the checkbox.

For the styling, you need to apply your own styles to make them look 'together' yourself.


use a Label and the for attribute.

The for attribute specifies which form element a label is bound to

<input id="Checkbox1" name="Checkbox1" type="checkbox" value="Admin" />
<label for="Checkbox1">AdminUser</label>

Also give your input a name

Tags:

Html

Css