I am facing a minor problem with aligning three input fields in the same row while maintaining equal spacing between each of them.
I attempted to accomplish this using display: flex
and space-between, but then the label appears to the left of the input instead of above it.
My desired outcome is as shown in the image below: https://i.sstatic.net/ic1rA.png
If there are more inputs, I would like them to "break a row" and begin a new row of three inputs.
How can I achieve this?
Here is a snippet of the code:
/*Stage 3 input group*/
.dInput{
margin-top: 15px;
}
.dInput label {
display: block;
padding: 6px;
color: #f8f9fa;
}
.dInput input {
padding: 5px;
margin-left: 5px;
width: 33%;
background-color: #495057;
border-radius: 4px;
}
<div class="dInput" v-if="activeStage == 3">
<label for="name">Username*</label>
<input type="text" id="name">
<label for="name">Username*</label>
<input type="text" id="name">
</div>