Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap - Button group with Label

Is it possible to have a button group, but one of the elements being a label.

Similar how Input Groups work with Input Groups Addon.

I basically want the button to look like a button but not have any effect when hovered over.

Best effort at the moment is using <a> with disabled, but that makes the colour slightly different to the rest of the page.

http://jsfiddle.net/sctqg038/

enter image description here

like image 891
Michal Ciechan Avatar asked Oct 31 '25 12:10

Michal Ciechan


1 Answers

I have updated the Fiddle. Just add a id to the button you want to use as a label and give the following css pointer-events:none. It won't change the button color.

Updated Fiddle

snippet

@import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
#label-btn {
  pointer-events: none;
}
<div class="btn-group">
    <a href="#" role="button" class="btn btn-success btn-xs" id="label-btn"  aria-disabled="true">T</a>
    <button type="button" class="btn btn-default btn-xs" aria-label="Import" data-toggle="tooltip" title="Import">
        <span class="glyphicon glyphicon-import" aria-hidden="true"></span>
    </button>
</div>
like image 87
philomath Avatar answered Nov 02 '25 02:11

philomath