Issue regarding designing UI : I am having problem designing below UI.

    [text1] [inputBox1]
    [text2] [inputBox2]
    [text3] [inputBox3]

text1, text2, text3 can be variable length. So if length of text increases, there width should increases and input box moves towards right. If text is much longer, than text wrapping should happen. Someone suggested me I should use flexbox. But I have no idea how to start with it. Can somebody please help me with it ?


Basic structure

    <div>
    <div>text1</div>
    <div>inputBox1</div>
    <div>text2</div>
    <div>inputBox2</div>
    <div>text3</div>
    <div>inputBox3</div>
    .
    .
    .
    .
    </div>
