HTML form with side by side input fields

后端 未结 6 1674
离开以前
离开以前 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:26

    For the sake of bandwidth saving, we shouldn't include

    for each of and pair

    This solution may serve you better and may increase readability

    The css for above form would be

    .form > label
    {
      float: left;
      clear: right;
    }
    
    .form > input
    {
      float: right;
    }
    

    I believe the output would be as following:

    Demo

提交回复
热议问题