Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3 Button Groups - how to make them links?

This seems really dumb to me, but what are the point of Bootstrap 3's button groups if you can't make them links?

http://getbootstrap.com/components/#btn-groups

We've tried this:

<button type="button" class="btn btn-lg btn-success" href="add.php">
<span class="glyphicon glyphicon-plus"></span> Add
</button>

And...

<button type="button" class="btn btn-lg btn-success">
<a href="add.php"><span class="glyphicon glyphicon-plus"></span> Add</a>
</button>

But neither work as links. What am I not understanding here? Thank you. NJ

like image 800
NathonJones Avatar asked Feb 04 '15 16:02

NathonJones


1 Answers

You can use the classes in bootstrap to change the a tag.

<div class="btn-group" role="group" aria-label="...">
  <a href="" class="btn btn-default">Left</a>
  <a href="" class="btn btn-default">Middle</a>
  <a href="" class="btn btn-default">Right</a>
</div>

<a href="add.php" class="btn btn-lg btn-success">
  <span class="glyphicon glyphicon-plus"></span> Add
</a

See the example here - http://www.bootply.com/v8anIQZU97

like image 148
haxtbh Avatar answered Sep 19 '22 14:09

haxtbh