为什么我看不到bootstrap类 - 本地驱动器上的html文件

时间:2013-12-03 10:39:10

标签: javascript html css angularjs twitter-bootstrap

开始使用Bootstrap的一个非常简单的方法是在HTML中引用BootstrapCDN中的Bootstrap CSS和JS。无需编译......(按照参考文献2中的说明) 在深入Bower之前,我想手动探索依赖项。所以我在Chrome中打开这个文件。角度的作品。 css类没有。 在html中,引用是否正确指向?如果是这样,我的班级为什么不显示?已经好几天了,房间里肯定有一些我没看到的大象。

    <html ng-app>
    <head>
    <script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js'>           </script>
    <!-- Bootstrap
    <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
 -->
    <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">

 <body ng-init="what = 'Angularjs'">
   <div class="container">
     <div class="navbar">
       <div class="navbar-inner">
         <a class="brand" href="#">Quick Start</a>
         <ul class="nav">
             <li><a ui-sref="route1">Route 1</a></li>
             <li><a ui-sref="route2">Route 2</a></li>
             <li ng-class="{ active: $state.includes('blue') }">
                <a href="#/blue">Blue</a>
             </li>
             <li ng-class="{ active: $state.includes('green') }">
                <a href="#/green">Green</a>
             </li>
        </ul>
       </div>
      </div>

      <div  class="row">
        <div class="span12">
        <div class="well" ui-view></div>
      </div>
      </div>

       Now your cooking with {{what}}!
       <hr/>
       {{"hello"+" world"}}
       <a href="http://stackoverflow.com/questions/17947084/how-to-host-an-angularjs-app-in-domain  ">Ref 1</a>
       <a href="http://stackoverflow.com/questions/16459363/is-there-an-easy-way-to-start-to-use-twitter-bootstrap ">Ref 2</a>
       </div>
       <!-- jQuery (necessary for Bootstrap's JavaScript plugins)
       <script src="https://code.jquery.com/jquery.js"></script>   -->
       <!-- Include all compiled plugins (below), or include individual files as needed
       <script src="js/bootstrap.min.js"></script>  -->

       <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
       </body>
       </html>

1 个答案:

答案 0 :(得分:2)

尝试使用:

<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet" />

而不是:

<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">

有时没有“http:”它不起作用。