How to place two input box next to each other using Bootstrap 4 ? Last Updated : 06 Sep, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we will learn how to take two inputs in a single line in HTML. HTML supports various type of inputs like text, password, Date-Time, date, time, week, number, email, and a lot more. There are various conditions where we have to take multiple inputs in a single line or next to each other and this can be achieved by .input-group and inline element. The inline element does not take the entire line rather takes as much width as necessary. Example 1: Taking input in two consecutive fields. html <!DOCTYPE html> <html> <head> <link rel="stylesheet" href= "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity= "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> </head> <body> <div class="input-group"> <!-- declaration for first field --> <input type="text" class="form-control input-sm" value="input 1 " /> <!-- reducong the gap between them to zero --> <span class="input-group-btn" style="width:0px;"></span> <!-- declaration for second field --> <input type="text" class="form-control input-sm" value="input 2" /> </div> </body> </html> Output: Example 2: Taking input as two fields in one line. html <!DOCTYPE html> <html> <head> <link rel="stylesheet" href= "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity= "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> </head> <body> <form class="form-inline" action="/action_page.php"> <label for="email">Email:</label> <input type="email" id="email" placeholder="Enter email" name="email"> <label for="pwd">Password:</label> <input type="password" id="pwd" placeholder="Enter password" name="pswd"> </form> </body> </html> Output: Example 3: Taking input in one line with mixed labels. html <!DOCTYPE html> <html> <head> <link rel="stylesheet" href= "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity= "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> </head> <body> <div class="input-group"> <span class="input-group-text">Between</span> <input type="text" class="form-control" placeholder="Type something..." /> <span class="input-group-text" style="border-left: 0; border-right: 0;"> and </span> <input type="text" class="form-control" placeholder="Type something..." /> </div> </body> </html> Output: Comment More infoAdvertise with us Next Article How to place two input box next to each other using Bootstrap 4 ? R rajatrathi Follow Improve Article Tags : Bootstrap HTML-Misc Bootstrap-4 Bootstrap-Misc Similar Reads How to place two bootstrap cards next to each other ? To place two Bootstrap cards next to each other, use Bootstrapâs grid system or flexbox utilities. By assigning the cards to columns like col-md-6 within a row or applying d-flex to the container, you can align the cards side by side responsively.Syntax:<div class="card" style="width: 20rem"> 3 min read How to put items underneath each other flex box in Bootstrap 4 ? Flexbox in Bootstrap 4: From bootstrap 3 to bootstrap 4 amazing change has occurred that bootstrap 4 can utilize flexbox to handle the layout of content. The FlexBox Layout Module makes it easier to design a flexible responsive layout structure. Approach: Place the direction of flex items in a flex 3 min read How to set dropdown and search box in same line using Bootstrap? A dropdown menu is a type of menu, by using the dropdown menu user can select something from the given predefined set. It is a toggleable menu, which means it appears when the user clicks on the menu. A search box is a type of box in which you can write the string that you want to search. The main a 3 min read How to align nested form rows using Bootstrap 4? Bootstrap is a CSS framework used to design web pages. Bootstrap along with HTML and JavaScript results in interactive web designs. The most recent release is Bootstrap v4.5. Bootstrap has a variety of components and utilities. The Bootstrap components include the form component. Bootstrap has an in 4 min read How to use Bootstrap to align labels with content into 4 columns ? The motive of this article is to align the content into four columns where the first two columns denote the labels and its content and the last two columns denote the labels and its content. The class "row" and "col" are used to create a grid which can be represented by a number of rows and columns. 2 min read Like