html - Bootstrap column with two fullwidth block buttons -
i want bootstrap column resize buttons nicely when screen type changes. buttons end no space between them , and 2 separate lines (on small screen).
how them resize smaller buttons, , not split onto new line?
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> <div class="container-fluid"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading">example!</div> <div class="panel-body"> <div class="form-group"> <div class="col-xs-3 col-xs-offset-4"> <a href="#" class="btn btn-success btn-block" role="button">add item</a> </div> <div class="col-xs-3"> <a href="#" class="btn btn-danger btn-block" role="button">remove item</a> </div> </div> </div> </div> </div> </div> </div>
if want same styling small devices large devices, can omit md
styling , use sm
. if width get's really small, can remove offset
, use gained width on elements instead on xs
widths.
to fix buttons being cut off, remove btn-block
class.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> <div class="form-group"> <div class="col-sm-3 col-sm-offset-3 col-xs-6"> <a href="#" class="btn btn-success" role="button">add item</a> </div> <div class="col-sm-3 col-xs-6"> <a href="#" class="btn btn-danger" role="button">remove item</a> </div> </div>
as side note, if want buttons centered here, use offset
3 instead of 4.
Comments
Post a Comment