Hyperlinking horizontal button group causes buttons to split apart
I'm trying to create a horizontal button group, however when you hyperlink the buttons it causes them to split apart into separate buttons.
Is there a fix for this? I've tried adding the a tags within the button but that just completely messed up the formatting.
Horizontal button group works (screenshot):
<div class="btn-group">
<button type="button" class="btn btn-danger">Button 1</button>
<button type="button" class="btn btn-danger">Button 2</button>
<button type="button" class="btn btn-danger">Button 3</button>
</div>
Horizontal button group splits into separate buttons once hyperlinked (screenshot):
<div class="btn-group">
<a href="test.php"><button type="button" class="btn btn-danger">Button 1</button></a>
<a href="test.php"><button type="button" class="btn btn-danger">Button 2</button></a>
<a href="test.php"><button type="button" class="btn btn-danger">Button 3</button></a>
</div>
Hey @chetcuti I had the same issue as well at one point but I figured it out using classes. Just use the hyperlink (a) but give the same classes of a button it will work like a charm. Might I suggest you give it a try, it will look something like this:
<div class="btn-group">
<a href="test.php" class="btn btn-danger">Button 1</a>
<a href="test.php" class="btn btn-danger">Button 1</a>
<a href="test.php" class="btn btn-danger">Button 1</a>
</div>
Let me know if that works for you,