2

我已按照文档进行操作,但我不确定我为什么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>
4

1 回答 1

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>

结果:

在此处输入图像描述

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

于 2015-01-09T05:24:44.753 回答