"Button Groups"
Bootstrap 4.1.1 Snippet by koshikojha

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="button-group" id="redBlack"> <h3>Button Group: Red-Black;<h3> <div class="button"> <span class="glyphicon glyphicon-headphones"></span> Music</div> <div class="button active"> <span class="glyphicon glyphicon-credit-card"></span> Shopping</div> <div class="button"> <span class="glyphicon glyphicon-cutlery"></span> Restaurants</div> <div class="button"> <span class="glyphicon glyphicon glyphicon-film"></span> Cinema</div> </div> <div class="button-group" id="thirdDimension"> <h3>Button Group: 3D;<h3> <div class="button"> <span class="glyphicon glyphicon-headphones"></span> Music</div> <div class="button prev"> <span class="glyphicon glyphicon-credit-card"></span> Shopping</div> <div class="button active"> <span class="glyphicon glyphicon-cutlery"></span> Restaurants</div> <div class="button next"> <span class="glyphicon glyphicon glyphicon-film"></span> Cinema</div> </div> <div class="button-group" id="orange"> <h3>Button Group: Orange;<h3> <div class="button active"> <span class="glyphicon glyphicon-headphones"></span> Music</div> <div class="button "> <span class="glyphicon glyphicon-credit-card"></span> Shopping</div> <div class="button"> <span class="glyphicon glyphicon-cutlery"></span> Restaurants</div> <div class="button"> <span class="glyphicon glyphicon glyphicon-film"></span> Cinema</div> </div> <div class="button-group" id="POP"> <h3>Button Group: POP;<h3> <div class="button"> Music<span class="glyphicon glyphicon-headphones"></span> </div> <div class="button"> Shopping<span class="glyphicon glyphicon-credit-card"></span></div> <div class="button"> Restaurants<span class="glyphicon glyphicon-cutlery"></span> </div> <div class="button active">Cinema <span class="glyphicon glyphicon glyphicon-film"></span> </div> </div>
* { margin: 0; padding: 0; font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: 100; } .button-group { margin: 100px auto; width: 600px; margin-bottom: 30px; } .button-group h3 { color: #999; text-align: center; font-size: 16px; margin-bottom: 10px; } .button-group#redBlack .button { background: linear-gradient(135deg, #292929, #191919); border: none; width: 120px; height: 120px; padding: 20px; display: inline-block; margin: -4px; color: #F2070B; font-size: 14px; text-align: left; text-shadow: 0 0 10px rgba(181, 26, 30, 0.4); box-shadow: 0px 10px 30px rgba(28, 28, 28, 0.9); } .button-group#redBlack .button span { text-align: center; margin: 20px 0 20px 0; display: block; color: #fff; font-size: 32px; text-shadow: none; } .button-group#redBlack .button:hover { background: linear-gradient(-45deg, #292929, #191919); } .button-group#redBlack .button.active { background: #B51A1E; color: #fff; box-shadow: inset 0px 0px 30px rgba(28, 28, 28, 0.9); } .button-group#orange .button { background: #F25824; width: 120px; height: 120px; padding: 20px; display: inline-block; margin: 0 -3px; color: #fff; font-size: 14px; text-align: center; text-shadow: 0 0 10px rgba(181, 26, 30, 0.4); box-shadow: 0px 0px 1px rgba(255, 255, 255, 0.9), 0px 10px 10px 0 rgba(111, 111, 111, 0.4); } .button-group#orange .button span { text-align: center; margin: 10px 0 20px 0; display: block; font-size: 32px; text-shadow: none; } .button-group#orange .button:hover { background: #CA4B1E; } .button-group#orange .button.active { text-shadow: 0 0 10px #fff; color: #fff; box-shadow: inset 0px 15px 15px 5px rgba(162, 63, 24, 0.9); } .button-group#orange .button.active span { text-shadow: 0 0 20px #fff; } .button-group#thirdDimension .button { background: linear-gradient(135deg, #39414E, #4C5363); border: none; width: 120px; height: 120px; padding: 20px; display: inline-block; margin: 0 -2px 30px -3px; color: #F89B72; font-size: 14px; box-shadow: 0px 2px 15px #323A45; position: relative; } .button-group#thirdDimension .button span { text-align: center; margin: 20px 0 20px 0; display: block; color: #fff; text-shadow: 0 2px 30px #323A45; font-size: 32px; } .button-group#thirdDimension .button:hover { background: linear-gradient(135deg, #4C5363, #39414E); } .button-group#thirdDimension .button.active { font-size: 14px; text-shadow: 0 0 10px #fff; background: linear-gradient(135deg, #4C5363, #39414E); color: #fff; height: 100px; vertical-align: bottom; } .button-group#thirdDimension .button.active span { text-shadow: 0 0 10px #fff; margin-top: 10px; font-size: 20px; } .button-group#thirdDimension .button.next:before { content: ''; position: absolute; z-index: 11; left: -25px; top: 0px; line-height: 90px; border-bottom: 20px solid #323A45; border-left: 25px solid transparent; } .button-group#thirdDimension .button.next:after { content: ''; position: absolute; z-index: 11; left: -25px; top: 20px; line-height: 90px; border-top: 100px solid #323A45; border-left: 25px solid transparent; } .button-group#thirdDimension .button.prev:before { content: ''; position: absolute; z-index: 11; left: 100%; top: 20px; line-height: 90px; border-top: 100px solid #323A45; border-right: 25px solid transparent; } .button-group#thirdDimension .button.prev:after { content: ''; position: absolute; z-index: 11; left: 100%; top: 0px; line-height: 90px; border-bottom: 20px solid #323A45; border-right: 25px solid transparent; } .button-group#POP .button { background: #EBE9EA; border: none; width: 120px; height: 120px; padding: 20px; display: inline-block; margin: -2px; color: #6C68B4; font-size: 16px; text-align: right; } .button-group#POP .button span { text-align: center; margin: 20px 0 0 -30px; display: block; font-size: 54px; text-shadow: none; } .button-group#POP .button:hover { background: #6C68B4; color: #fff; } .button-group#POP .button.active { text-shadow: 0 0 10px rgba(181, 26, 30, 0.4); background: #6C68B4; color: #fff; transform: translate(10px, -10px); z-index: 100; box-shadow: -8px 8px 0px 2px rgba(28, 28, 28, 0.3); }
$(document).ready(function() { buttonClick('#redBlack'); buttonClick('#orange'); buttonClick('#POP'); buttonClickPN('#thirdDimension') }) function buttonClick(string) { $(string).find(".button").click(function() { if (!$(this).hasClass('active')) { $(string + ' .active').removeClass('active'); $(this).addClass('active'); } }) } function buttonClickPN(string) { $(string).find(".button").click(function() { if (!$(this).hasClass('active')) { $(string + ' .active').removeClass('active'); $(string + ' .prev').removeClass('prev'); $(string + ' .next').removeClass('next'); $(this).addClass('active'); $(this).prev().addClass('prev'); $(this).next().addClass('next'); } }) }

Related: See More


Questions / Comments: