html - Directive inside partial appears with a bar on top -


i creating ui using angular on front end. have directive navbar. since using ngroute, have used directive inside partial /home. works fine, navbar not start top of page. instead there small pane below navbar starts. want how stack overflow navbar in top is.

this index.html

<body> <ng-view></ng-view> </body> 

i've tried using ng-view inside div still not work.

home.html

<nav-bar></nav-bar> <div class="container">         <div class="row-fluid">             <div class="col-md-12">                 <div class="well well-sm">{{flashmessage}}</div>             </div>         </div>         <div class="row-fluid">             <div class="col-md-3 pre-scrollable scroll-pane">                 <span class="glyphicon glyphicon-folder-close"></span>                 <a href="#toparentnode">                     ..                 </a>                 <br/>                 <p>nodes list goes here</p>             </div>             <div class="col-md-9 pre-scrollable scroll-pane">                 <table class="table table-striped table-bordered wrap-table text-center">                     <thead>                         <tr>                             <th>name</th>                             <th>action</th>                         </tr>                     </thead>                     <tbody>                         <tr>                             <td>value1</td>                             <td>                                 <button class="glyphicon glyphicon-edit"></button>                                 <button class="glyphicon glyphicon-remove"></button>                             </td>                         </tr>                         <tr>                             <td>value2</td>                             <td>                                 <button class="glyphicon glyphicon-edit"></button>                                 <button class="glyphicon glyphicon-remove"></button>                             </td>                         </tr>                         <tr>                             <td>value3</td>                             <td>                                 <button class="glyphicon glyphicon-edit"></button>                                 <button class="glyphicon glyphicon-remove"></button>                             </td>                         </tr>                         <tr>                             <td>value4</td>                             <td>                                 <button class="glyphicon glyphicon-edit"></button>                                 <button class="glyphicon glyphicon-remove"></button>                             </td>                         </tr>                     </tbody>                 </table>             </div>         </div>     </div> 

navbar.html ( templateurl navbar directive )

<nav class="navbar navbar-default navbar-inverse">     <div class="container-fluid">         <!-- brand , toggle grouped better mobile display -->         <div class="navbar-header">             <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">                 <span class="sr-only">toggle navigation</span>                 <span class="icon-bar"></span>                 <span class="icon-bar"></span>                 <span class="icon-bar"></span>             </button>             <a class="navbar-brand navbar-right" href="#/">             <img style="max-width:100px; margin-top: -7px;" src="images/logo.png" alt="logo">              </a>         </div>         <!-- collect nav links, forms, , other content toggling -->         <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">             <ul class="nav navbar-nav">                 <li><a href="#/home"><span class="glyphicon glyphicon-home"></span> home<span class="sr-only">(current)</span></a></li>                 <li><a href="#">link</a></li>             </ul>             <form class="navbar-form navbar-left" role="search">                 <div class="form-group">                     <input type="text" class="form-control" placeholder="search">                 </div>                 <button type="submit" class="btn btn-default">submit</button>             </form>             <ul class="nav navbar-nav navbar-right">                 <li><a href="#"><span class="glyphicon glyphicon-log-out"></span> logout</a></li>             </ul>         </div>         <!-- /.navbar-collapse -->     </div>     <!-- /.container-fluid --> </nav> 

i have used twitter bootstrap , 1 css named signin.css 1 found in official website example - css

this unnecessary pane in top enter image description here

but want how stack overflow has navbar.

i've tried adding navbar directly main index.html , works expected. unnecessary pane appears when use directive. hope question clear.

from css try removing

body {  padding-top: 40px; } 

Comments