For a practice exercise, I want to achieve vertical left alignment and horizontal stretching of input fields using only Bootstrap Flex (or CSS3 flexbox), without relying on Bootstrap Grid or CSS3 grid layout.
Here is the code snippet (also available on codepen.io)
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="d-flex flex-wrap flex-column">
<div class="d-flex flex-row">
<div class="flex-fill"><label>Field ABC 1</label></div>
<div class="flex-fill"><input type="text" /></div>
</div>
Here is the visual representation of the code
https://i.sstatic.net/8BOBs.png
I have attempted using align-self-* on the item divs without success. I also experimented with applying the class directly to the input elements.
Subsequently, I removed the divs around the labels and inputs. Now, they stretch horizontally, but the vertical alignment remains unchanged.
The current outcome of the code looks like this
https://i.sstatic.net/iPhow.png
As a secondary question, I have placed each input and label within a div. Is this approach technically correct, good practice, or is it considered excessive in terms of HTML/CSS conventions?