Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap panel-footer with button pull-right

I have the following HTML element with bootstrap:

 <div class="panel-footer">
                            <button type="button" id="btnSave" class="btn btn-default pull-right">Save</button>
                        </div>

enter image description here

If you see there is a gray area (panel-footer): enter image description here

The button uses pull-right class also that is float:right, but I would like the gray area that is actually the panel-footer div to fit within the button height.

This is the styles for panel-footer:

enter image description here

And this for the pull-right:

enter image description here

Any clue?

UPDATE:

I added after the button:

<div class="clearfix"></div>

And seems that fixed the problem. Is that ok?

like image 202
VAAA Avatar asked Nov 19 '16 20:11

VAAA


1 Answers

you can try this.

<div class="panel-footer text-right">
   <button type="button" id="btnSave" class="btn btn-default pull-right">Save</button>
</div>

You just need to add text-right class to your panel-footer.

It works for me.

like image 151
YEN YEE Avatar answered Oct 18 '22 18:10

YEN YEE