<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>
<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>