I can’t seem to get <label> and <input> on the same line under "Schedule preferences". CodePen here.
I’ve tried floating and table cell attribute manipulation. Any help would be greatly appreciated as something this simple shouldn’t be giving me such a difficult time.
<label for="schedule-preference">Schedule Preferences:</label><br />
<input type="checkbox" id="weekday" name="schedule_preference" value="weekday">
<label for="weekday">Weekday</label>
<input type="checkbox" id="weekday_evenings" name="schedule_preference" value="weekday_evenings">
<label for="weekday_evenings">Weekday evenings</label>
<input type="checkbox" id="weekend" name="schedule_preference" value="weekend">
<label for="weekend">Weekend</label><br>
2
Answers
It’s because your labels are all styled with either
display: table-cell
ordisplay: block
. For the labels you want to appear beside their inputs, you’ll need to style them asdisplay: inline
ordisplay: inline-block
.If i understand correctly you need to wrap the label around the input:
and then maybe some specific CSS for the checkbox input