Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Align Button to right of progress bar

Can anybody please help me align the Cancel button to the right of the progress bar? I've tried float and display inline with no success, and I'm out of ideas.

Here's the code:

<div class="row">
  <div class="progress progress-striped active" style="width: 500px; margin: 0px auto; height: 40px;">
    <div id="progressbar" class="progress-bar progress-bar-success" role="progressbar" style="width:20%;"></div>
  </div>
  <div style="display: inline;"><button class="btn btn-warning">Cancel</button></div>
</div>

Here's a fiddle of it demonstrating my problem:

like image 313
b0xxed1n Avatar asked Nov 22 '25 12:11

b0xxed1n


2 Answers

Try to this Define pull-left of your div as like this

<br><br><br>
<div class="row">
  <div class="progress progress-striped active pull-left" style="width: 500px; margin: 0px auto; height: 40px; margin-right:10px;"><div id="progressbar" class="progress-bar progress-bar-success" role="progressbar" style="width:20%;"></div></div>

    <button class="btn btn-warning pull-left">Cancel</button>

</div>

Demo

like image 113
Rohit Azad Malik Avatar answered Nov 24 '25 02:11

Rohit Azad Malik


I added float:left to both the loading bar and the cancel button, plus some slight css to align the cancel button better such as top and left:

UPDATED EXAMPLE

like image 20
SaturnsEye Avatar answered Nov 24 '25 02:11

SaturnsEye



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!