S
S
Stepan2016-06-17 11:28:12
css
Stepan, 2016-06-17 11:28:12

How to make a form in Bootstrap in which the password field and the button will be on the same line?

I just need the elementary form code on the Bootstrap framework as in the picture. So that the password field and the button are on the same line. Thank you!2225df76c16f46dfbb32a365c5b85cf8.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Eremin, 2016-06-17
@EreminD

<div class="input-group">
      <input type="text" class="form-control" placeholder="Search for...">
      <span class="input-group-btn">
        <button class="btn btn-default" type="button">Go!</button>
      </span>
</div>

getbootstrap.com/components/#input-groups
UPD: whole form
<div class="container">
  <div class="row">
  <input type="text" class="form-control" placeholder="Login">
  </div>
  <div class="row">
    <div class="input-group">
      <input type="text" class="form-control" placeholder="Password">
      <span class="input-group-btn">
        <button class="btn btn-default" type="button">Log in</button>
      </span>
    </div>
  </div>

M
maxt888, 2016-06-17
@maxt888

<div class="container">
  <div class="row">
  <input type="text" class="form-control myinput" placeholder="Login">
  </div>
  <div class="row">
    <div class="input-group">
      <input type="text" class="form-control" placeholder="Password">
      <span class="input-group-btn">
        <button class="btn btn-default" type="button">Log in</button>
      </span>
    </div>
  </div>

CSS code:
.row .myinput{
   width:200px;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question