下面代码中data-target="#bs-example-navbar-collapse-1"和id="bs-example-navbar-collapse-1"之间关系
<divclass="navbarnavbar-inverse"><divclass="navbar-header"><!--自适应隐藏导航展开按钮--><buttont...
<div class="navbar navbar-inverse">
<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>
<!-- 导航条LOGO -->
<a class="navbar-brand" href="#">Brand</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="">首页</a></li>
<li><a href="">博文</a></li>
<li><a href="">留言</a></li>
</ul>
</div>
</div> 展开
<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>
<!-- 导航条LOGO -->
<a class="navbar-brand" href="#">Brand</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="">首页</a></li>
<li><a href="">博文</a></li>
<li><a href="">留言</a></li>
</ul>
</div>
</div> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询