Currently, the input="number" is in the top right hand corner of the flexbox. When I change it from input="number" to input="checkbox" it becomes aligned. How do I make it so that when it is input="number" it aligns with the rest of the checkboxes?
body {
background-color : #6d6875;
font-family : 'Open Sans', sans-serif;
}
#options-div {
background-color : #b5838d;
margin : 200px auto;
padding : 20px;
width : 350px;
text-align : center;
border : 2px solid white;
}
#password-output {
width : 200px;
}
#num-box {
width : 30px;
height : 30px;
}
.options {
display : flex;
justify-content : space-between;
border : 2px solid black;
}
<div id="options-div">
<h1>Password generator</h1>
<input id="password-output" type="number">
<div class="options">
<p>Password length</p>
<input id="num-box" type="number">
</div>
<div class="options">
<p>Include uppercase letters</p>
<input type="checkbox">
</div>
</div>
3
Answers
With this, the input box for each choice will be positioned to the right of the text. By changing the width of the elements or adding padding or margin, you can change the distance between the text and the input box.
Try to do it:
Change the
<p>
for<label>
and add with yourdisplay: flex
thejustify-content: space-between
and thealign-items: center
.In this case, the align-items will align the content in the
center
of your line.I hope I’ve helped!