HTML form with side by side input fields

后端 未结 6 1683
离开以前
离开以前 2021-02-05 10:52

I have a html form that is basically vertical but i really have no idea how to make two text fields on the same line. For example the following form below i want the First and L

6条回答
  •  春和景丽
    2021-02-05 11:35

    You should put the input for the last name into the same div where you have the first name.

    Then, in your CSS give your #user_first_name and #user_last_name height and float them both to the left. For example:

    #user_first_name{
        max-width:100px; /*max-width for responsiveness*/
        float:left;
    }
    
    #user_lastname_name{
        max-width:100px;
        float:left;
    }
    

提交回复
热议问题