Can i put border to a form using bootstrap?

Viewed 29795

I have this code below, and i want to add a border to make like a box using bootstrap class ".border", but i can't figure out why is not working!. Is possible using bootstrap v4?

<div class="d-flex justify-content-center">
      <form>
        <div class="form-group row">
          <div class="col-sm-12">
            <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
          </div>
        </div>
        <div class="form-group row">
          <div class="col-sm-12">
            <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
          </div>
        </div>
        <div class="form-group row">
          <div class=" col-sm-12">
            <button type="submit" class="btn btn-primary">Sign in</button>
          </div>
        </div>
      </form>
    </div>
6 Answers

Here is a pretty good combination for a bordered form with background color:

<form class = 'card p-3 bg-light'>

Looked good for my case.

I know this is a very late response, but I feel obligated to share a more "bootstrap" way of doing this. Simply use the classes card and p-1 for a border and padding between your content and said border.

<form class = 'card p-1'>

add "well" tag to your outer div element

Ex : < div class="col-lg-6 col-md-6 col-sm-12 well" >

Related