Home  >  Q&A  >  body text

Put the input under label

I've been trying for days but I can't do this, how do I achieve this? I don't understand, how to put two labels (fname lname) on the same line and put the corresponding input below them? This is a sketch of what I want to do

I know this is a simple task for you all but I keep at it and I can do it but they end up on different lines or I only complete the first task but The label on the second task disappeared

P粉311423594P粉311423594369 days ago410

reply all(1)I'll reply

  • P粉111641966

    P粉1116419662023-09-16 00:44:35

    Here you go, no flex/grid required:

    label {
      display: inline-block;
    }
    
    input {
      display: block
    }
    <label>
      First Name
      <input/>
    </label>
    <label>
      Last Name
      <input/>
    </label>

    reply
    0
  • Cancelreply