我有这个问题我该如何解决?
这是HTML代码:
HTML
<nav class="navbar navbar-default " role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Hyper Design</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">What We Do</a></li>
<li><a href="#">Our Works</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Link</a></li>
<button type="button" class="btn btn-default navbar-btn">Sign in</button>
</ul>
</li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
答案 0 :(得分:0)
<center>item1</center><br />
<div id="field">content of item 2</div>
<style>
#field {
width: 100%;
text-align: center;
}
</style>
答案 1 :(得分:0)
答案 2 :(得分:0)
试试这个:
只需在折叠标记
中使用text-center
类
<div class="collapse navbar-collapse text-center" id="bs-example-navbar-collapse-1">