"Bootstrap 3.3.X nav-pills matrix"
Bootstrap 3.3.0 Snippet by olivierlabbe

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="col-xs-6"> <ul class="nav nav-pills nav-matrix"> <li role="presentation"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li role="presentation"><a href="#">Messages</a></li> <li role="presentation"><a href="#">pills 4</a></li> <li role="presentation"><a href="#">pills 5</a></li> <li role="presentation"><a href="#">oversize text in the pills</a></li> <li role="presentation"><a href="#">pills 7</a></li> <li role="presentation"><a href="#">pills 8</a></li> <li role="presentation"><a href="#">pills 9</a></li> </ul> </div> </div> </div>
.nav.nav-matrix { display: flex; flex-wrap: wrap; align-content: stretch; } .nav.nav-matrix li { width: 24%; // 24% for 4 cols -- 33% for 3 and 49% for 2 display: flex !important; align-content: center; } .nav.nav-matrix li a { display:flex !important; align-items:center; flex-grow:1; }

Related: See More


Questions / Comments: