如何使导航栏元素在行的中心?

时间:2019-03-18 13:58:40

标签: html css html5 twitter-bootstrap css3

.container > ul li {
  text-align:center;
}
<div class="navbar navbar-default navbar-fixed-top" >
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar2">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>                        
            </button>
            <a class="navbar-brand" href="resume.html">PB</a>
        </div>
        <div class="collapse navbar-collapse" id="myNavbar2">
            <ul class="nav navbar-nav" id="cen">
               
					<li><a href = "#"><span class = "glyphicon glyphicon-log-in"></span> About me</a></li>
                    <li><a href = "#"><span class = "glyphicon glyphicon-shopping-cart"></span> Resume </a></li>
                    <li><a href = "#"><span class = "glyphicon glyphicon-user"></span> Training Details</a></li>
                    <li><a href = "#"><span class = "glyphicon glyphicon-log-in"></span> contact me</a></li>
				</ul>
        </div>
    </div>
</div>

这是我的代码。我不知道该怎么做。实际上,我尝试了所有发布在这里的prevoius答案,但是这些对我没有帮助。请任何人帮助我..谢谢。

0 个答案:

没有答案