I have read through the answers provided, but nothing seems to work for me. My goal is to place a label and 2 small form fields on the same line, with about 90px of space between the label and the fields. I am aiming for a layout similar to the image shown below.
https://i.sstatic.net/mrCir.png
I am facing difficulties in aligning the label "Monday" with the 2 field forms on the same line. Even when I manage to achieve this, one of the form fields ends up dropping to the next line. It's frustrating trying to figure out something that should be simple.
Currently, my setup looks like this:
https://i.sstatic.net/4KBsU.png
Please assist!
div.form-group{
width:100%;
float:left;
width: 100%;
margin-left: 450px;
margin-top: -340px;
z-index:-2;
}
div.form-group > label,[type=text]{
float:left;
}
div.form-group > label{
width:100px;
text-align: left;
padding-left: -10px;
margin-right: 40px;
z-index:9;
}
div.form-group[type=text]{
margin-left: 50px;
z-index: 1
}
<div class="form-group">
<label for="Monds"> Monday </label>
<input type="text" name="Monds" id="Mon" class="open_hours" placeholder="--:--" required tabindex="8">
<input type="text" name="Monds" id="Monday" class="open_hours" placeholder="--:--" required tabindex="9">
<div>