How to set an button align-right with Bootstrap?

Viewed 227561

I am learning Bootstrap. The structure is a container within some context. At the bottom of the container, I put a button next to an description.

Now, I want to set the button align to the right without break the bootstrap structure. What should I do? I had set the "float:right" to the button style, but it appeared bad. The button is outside the "alert-info" background and not vertical align. Any better method?

<div class="alert alert-info">
<a href="#" class="alert-link">Summary:Its some description.......testtesttest</a>  
<button type="button" class="btn btn-primary btn-lg" style="float:right;">Large      button</button>
 </div>
6 Answers

This worked for me:

<div class="text-right">
    <button type="button">Button 1</button>
    <button type="button">Button 2</button>
</div>

This work for me in bootstrap 4:

    <div class="alert alert-info">
      <a href="#" class="alert-link">Summary:Its some description.......testtesttest</a>  
      <button type="button" class="btn btn-primary btn-lg float-right">Large button</button>
    </div>

You can use the class name float-right:

function Continue({show, onContinue}) {
  return(<div className="row continue">
  { show ? <div className="col-11">
    <button class="btn btn-primary btn-lg float-right" onClick= {onContinue}>Continue</button>
    </div>
    : null }
  </div>);
}
Related