I am trying to create a webform. The checkboxes are coming after the label and therefore all the checkboxes are not lined up. How can I get the checkboxes to come before the text?
<label for="needs">Please select if you have: </label>
<p>
<p>
<label for="monitor" class="checkboxes">Monitor(s)
<input id="monitor" name="monitor" type="checkbox" value="1" /><br>
</label>
<label for="Keyboard" class="checkboxes">Keyboard
<input id="Keyboard" name="Keyboard" type="checkbox" value="1" /><br>
</label>
<label for="Mouse" class="checkboxes">Mouse
<input id="Mouse" name="Mouse" type="checkbox" value="1" /><br>
</label>
<label for="Dock" class="checkboxes">Docking Station
<input id="Dock" name="Dock" type="checkbox" value="1" /><br>
</label>
<label for="webcam" class="checkboxes">Webcam
<input id="webcam" name="webcam" type="checkbox" value="1" /><br>
</label>
<label for="Printer" class="checkboxes">Printer
<input id="Printer" name="Printer" type="checkbox" value="1" /><br>
</label>
2
Answers
Move the checkbox inputs before the labels.
place the
label
after theinput
,In this case, there is no need for the
input
to be inside thelabel
, as shown hereif necessary, use a
div
to wrap thelabel
and theinput
as in the example here.