所以这是一个bootstrap模板的代码
<div class="collapse navbar-collapse col-md-5 col-md-offset-5">
<ul class="nav navbar-nav">
<li><a href="#main-header"><i class="icon-home"</i></a></li>
<li><a href="#info">Info</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>
内部链接正在运行,但我无法通过图标将其链接到外部html doc。这是我给的代码...........(在第一个列表项中更改)
<div class="collapse navbar-collapse col-md-5 col-md-offset-5">
<ul class="nav navbar-nav">
<li><a href="index.html"><i class="icon-home"></i></a></li>
<li><a href="#info">Info</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
答案 0 :(得分:0)
您的代码运行正常,我只是替换了图标类。
以全屏模式运行(因为您正在使用md
偏移量):
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="collapse navbar-collapse col-md-5 col-md-offset-5">
<ul class="nav navbar-nav">
<li><a href="index.html"><i class="glyphicon glyphicon-home" ></i></a>
</li>
<li><a href="#info">Info</a>
</li>
<li><a href="#contact">Contact</a>
</li>
</ul>
</div>