Bootstrap 3导航丸不起作用

时间:2015-01-09 05:11:09

标签: twitter-bootstrap nav-pills

我已按照文档进行操作,但我不确定为什么pills无效。

HTML:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
    <script src="assets/js/script.js"></script>
    <link rel="stylesheet" media="all" href="assets/css/style.css"/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
    <div class="row">
    <nav class="nav navbar-nav">
         <ul class="nav nav-pills">
            <li>blah</li> 
        </ul>
    </nav>

    </div>
</div>

</body>
</html>

1 个答案:

答案 0 :(得分:2)

您的预期结果是什么?您是否可以尝试插入一些<li>标记以查看其是否正常工作?

<ul class="nav nav-pills">
  <li role="presentation" class="active"><a href="#">Home</a></li>
  <li role="presentation"><a href="#">Profile</a></li>
  <li role="presentation"><a href="#">Messages</a></li>
</ul>

仅供参考:http://getbootstrap.com/components/#nav-pills

还请附上上面指定的assets / css / style.css文件。建议将Bootstrap CDN放在<head>的顶部,位于自定义css文件上方。

===========更新===========

<!DOCTYPE html>
<html>
 <head>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
 </head>
 <body>
  <div class="container">
    <div class="row">
      <nav class="nav navbar-nav">
         <ul class="nav nav-pills">
            <li role="presentation"><a href="#">Blah</a></li>
            <li role="presentation"><a href="#">Blah</a></li>
            <li role="presentation"><a href="#">Blah</a></li>
        </ul>
      </nav>
    </div>
  </div>
 </body>
</html>

结果:

enter image description here

这是你预期的药丸效果吗?