Bootstrap Tutorial - Create mini button group








The following code shows how to create mini button group.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
<style type='text/css'>
.mark_selector_button {<!--from  w w w. java  2 s  .c o m-->
  width: 80px;
}
</style>
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
$('.mark_selector_button').click(function() {
    if ($(this).hasClass('active')) {
        $(this).removeClass('btn');
    }  
});
});//]]>  
</script>
</head>
<body>
  <div class="btn-group btn-group-vertical mark_selector"
    data-toggle="buttons-radio">
    <button class="btn btn-mini mark_selector_button">Species</button>
    <button class="btn btn-mini mark_selector_button">Unit</button>
    <button class="btn btn-mini mark_selector_button">Data</button>
  </div>
</body>
</html>

Click to view the demo