html - Unable to position well to center -


i trying position center of page. there similiar questions on so, code different mine. html given below:

        <div class="container">             <div class="row">                 <div class="well col-sm-4" align="center">                     <div class="text-center">                         <p><h2>login</h2></p>                     </div>                     <hr>                     <form role="form">                         <div class="form-group text-center">                                <label for="username">username</label>                             <input type="text" class="form-control" id="username">                         </div>                         <div class="form-group text-center">                             <label for="password">password</label>                             <input type="password" class="form-control" id="password">                         </div>                         <hr>                         <div class="text-center">                             <button type="submit" class="btn btn-primary">submit</button>                             <button type="button" class="btn btn-warning">forgot password</button>                         </div>                         <hr>                         <div class="text-center">                             <p>don't have account yet? <a>create 1 now</a></p>                         </div>                      </form>                    </div>             </div>         </div> 

i tried putting div inside div col-md-12 , other values, did not centered. know how center in page?

you put 2 dummy divs make centered. have noticed have 1 col-sm-4

try this:

<div class = "col-sm-4"></div> <div class = "well col-sm-4"> <!-- content here --> </div> <div class = "col-sm-4"></div> 

in way can have well centered.

you can this

<div class = "well col-md-6 col-md-offset-3"> <!-- content here --> </div> 

to make centered on desktop view 1280px , above.


Comments