css - bootstrap panel heading - aligning controls horizontally -
i trying align controls in bootstrap panel-heading , not aligning horizontally. see fiddler: https://jsfiddle.net/99x50s2s/23/
html:
<div id="datarow" class="col-md-12"> <div class="panel panel-info"> <div class="panel-heading"> <div class="col-md-2"> <h3 class="panel-title"> <a class="btn btn-warning btn-xs" data-toggle="collapse" data-parent="#datarow" href="#collapsedata" aria-expanded="true" aria-controls="collapsedata"> <span class="glyphicon glyphicon-collapse-down"></span> </a> data</h3> </div> <div class="col-md-10"> <button class="btn btn-danger btn-xs disabled" id="downloadbtn" type="button" title="download data"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> download</button> </div> </div> <div id="collapsedata" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingone"> <div class="panel-body"> <div class="form-inline col-sm-12 move-down-sm"> controls displayed here </div> <div class="form-horizontal col-sm-12 move-down-sm"> controls displayed here </div> <div class="form-inline col-sm-12 move-down-sm"> controls displayed here </div> </div> <div class="panel-footer"> <button class="btn btn-success btn-xs" id="savechangesbtn" type="button" title="save changes"><span class="glyphicon glyphicon-floppy-save" aria-hidden="true"></span> save changes</button> </div> </div> </div> </div>
what best way align controls horizontally in panel-heading without overwriting bootstrap classes?
expectation:
your markup needs changed bit:
<div id="datarow" class="col-md-12"> <div class="panel panel-info"> <div class="panel-heading"> <h3 class="panel-title"> <a class="btn btn-warning btn-xs" data-toggle="collapse" data-parent="#datarow" href="#collapsedata" aria-expanded="true" aria-controls="collapsedata"> <span class="glyphicon glyphicon-collapse-down"></span> </a> data <button class="btn btn-danger btn-xs disabled" id="downloadbtn" type="button" title="download data"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> download</button> </h3> </div> <div id="collapsedata" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingone"> <div class="panel-body"> <div class="form-inline col-sm-12 move-down-sm"> controls displayed here </div> <div class="form-horizontal col-sm-12 move-down-sm"> controls displayed here </div> <div class="form-inline col-sm-12 move-down-sm"> controls displayed here </div> </div> <div class="panel-footer"> <button class="btn btn-success btn-xs" id="savechangesbtn" type="button" title="save changes"><span class="glyphicon glyphicon-floppy-save" aria-hidden="true"></span> save changes</button> </div> </div> </div> </div>
basically, removed col-*-2
, col-*-10
panel-heading
, , surrounded <a>
, data
, <button>
in same <h3 class="panel-title">
element. if want button on right hand side, add <span class="pull-right">
around <button class="btn btn-danger" ...>
so:
<span class="pull-right"> <button class="btn btn-danger btn-xs disabled" id="downloadbtn" type="button" title="download data"> <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> download </button> </span>
Comments
Post a Comment