2

I have followed the documentation but I am unsure why my pills are not working.

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>
Jess McKenzie
  • 8,345
  • 27
  • 100
  • 170

1 Answers1

2

What is your expected result ? Can you try to insert some <li> tags to see whether it works properly ?

<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>

FYI: http://getbootstrap.com/components/#nav-pills

Please also attach the assets/css/style.css file specified above. It is suggested to place the Bootstrap CDN at the top of <head>, above your custom css file.

=========== Updates ===========

<!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>

Result:

enter image description here

Is that your expected pill effect ?

tony.0919
  • 1,145
  • 5
  • 16
  • 27
  • I have attached my whole HTML document and you can see I using the CDN that does have the `nav-pills` CSS in it. I do have `
  • ` in my code. I am just not getting the "pill" effect as I should be
  • – Jess McKenzie Jan 09 '15 at 05:28
  • I am getting no effect at all – Jess McKenzie Jan 09 '15 at 05:46
  • I've updated my comment. Please let me know if you still have problem ? In fact, if you use `//ajax/googleapis...` instead of `http://ajax/googleapis...`, and open index.html directly, you will get `Uncaught ReferenceError: jQuery is not defined` error message. – tony.0919 Jan 09 '15 at 05:49