html form - make inputs appear on the same line

前端 未结 7 2202
臣服心动
臣服心动 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:00

    You can wrap the following in a DIV:

    Give each input float:left in your CSS:

    .your-class input{
      float:left;
    }
    

    example only

    You might have to adjust margins.

    Remember to apply clear:left or both to whatever comes after ".your-class"

提交回复
热议问题