2016-02-04 85 views
0

我有一個非常簡單的頁面,它由一個導航欄和一些按鈕組成。但是,當我使用移動設備訪問該頁面時,這些按鈕不顯示。在移動設備上沒有顯示Navbar按鈕

我檢查了幾個線程,如this和這個this,但我不明白我的問題在哪裏。

Fiddle link

代碼:

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Flask Template Example</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" media="screen"> 
    <style type="text/css"> 
     .container { 
     max-width: 1400px; 
     padding-top: 100px; 
     } 
     h2 {color: #55acee;} 
    </style> 
</head> 
<body> 
<nav class="navbar navbar-inverse" role="navigation"> 
<div class="container-fluid"> 
    <div class="navbar-header"> 
     <a class="navbar-brand" href="/">My API</a> 
    </div> 

    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 
     <ul class="nav navbar-nav"> 
      <li><a href="/Test">Test</a></li> 
      <li><a href="/endpoints">Endpoints</a></li> 
      <li><a href="/about">Information</a></li> 
     </ul> 
    </div><!-- /.navbar-collapse --> 
    </div><!-- /.container-fluid --> 
</nav> 
    <div class="container"> 
     <!--<h2>This is part of my base template</h2>--> 
     <br> 

     <h2>Hello</h2> 

     <br> 
     <!--<h2>This is part of my base template</h2>--> 
    </div> 
    <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> 
    <script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> 

感謝

回答

1

你忘了包括代碼,顯示了可摺疊導航欄菜單:

替換:

<div class="navbar-header"> 
    <a class="navbar-brand" href="/">My API</a> 
</div> 

有:

<div class="navbar-header"> 
    <a class="navbar-brand" href="/">My API</a> 
     <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> 
     <span class="sr-only">Toggle navigation</span> 
     <span class="icon-bar"></span> 
     <span class="icon-bar"></span> 
     <span class="icon-bar"></span> 
     </button> 
</div> 
+0

這做的工作,非常感謝。 – user3276768

相關問題