html form - make inputs appear on the same line

前端 未结 7 2132
臣服心动
臣服心动 2021-01-03 19:17

I am struggling to make two html form inputs (first and last name) appear on the same line side by side. I have tried using float, but that seems to make the rest of the inp

相关标签:
7条回答
  • 2021-01-03 20:23

    use table

    <table align="center" width="100%" cellpadding="0" cellspacing="0" border="0"> 
    <tr>
    <td><label for="First_Name">First Name:</label></td>
    <td><input name="first_name" id="First_Name" type="text" /></td>
    <td><label for="last_name">Last Name:</label></td> <td> 
    <input name="last_name" id="Last_Name" type="text" /></td> 
    </tr> 
    <tr> 
    <td colspan="2"><label for="Email">Email:</label></td> 
    <td colspan="2"><input name="email" id="Email" type="email" /></td> 
    </tr> 
    <tr> 
    <td colspan="4"><input type="submit" value="Submit"/></td> 
    </tr> 
    </table>
    
    0 讨论(0)
提交回复
热议问题