I'm having trouble centering link1 and link2 both horizontally and vertically on the page. The horizontal alignment is working fine, but I can't seem to get the vertical alignment right, no matter what I try.
Here is the HTML code snippet:
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- <%= link_to 'Home', root_path %> -->
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>Link 1</li>
<li>Link 2</li>
</ul>
</div>
</div>
</nav>
And here is the CSS code snippet:
.navbar .navbar-nav
display: inline-block
float: none
vertical-align: middle
.navbar .navbar-collapse
text-align: center
/* styling for links */
.navbar-nav > li
margin: 3px
text-transform: uppercase
font-weight: bold
color: white
Can anyone help me with a solution to center link1 and link2 both vertically and horizontally? Also, should I be using Bootstrap or developing everything with custom CSS?