How do I position the input checkboxes to the very left side. I have a container div with flex, justify content and align items center, but want checkboxes starting to the left.
.candidate label {
display: flex;
}
.candidate label input {
position: absolute;
}
/*I tried using: */
.candidate label {
display: flex;
}
.candidate label input {
position: absolute;
}
<div class="item candidate">
<p>Why are you the perfect Candidate?</p>
<label>
<input name="candidate" value="Cat-Person" type="checkbox"/>
Because I am a Cat Person
</label>
<label>
<input name="candidate" value="Companion" type="checkbox"/>
Looking for a Companion
</label>
<label>
<input name="candidate" value="Help" type="checkbox"/>
Want to help Cats
</label>
</div>
3
Answers
Solved my problem with
I have just remove the both of your position property in css and it all goes well now
To position input checkboxes to the left of the content, simply use
display: flex;
on the containerdiv
and add somegap
with the gap property. For vertical alignment, usealign-items: center;
. No need to use theposition
property.