title: Django template inheritance breaks site layout
body: <p>I'm currently using django 1.3.1, trying to implement template inheritance, to minimize the amount of duplicated code.
  I'm also using twitter-bootstrap v2.0. </p>
  
  <p>I have a base html-file, containing the navbar.
  It contains a single {% block %} which is below the navbar, inside a div-tag, like this:</p>
  
  <pre><code>&lt;div class="container"&gt;
      {% block content %} {% endblock %}
  &lt;footer&gt;
      &lt;p&gt;Designad och skapad av Johan Rende, jrende@kth.se, 2012&lt;/p&gt;
  &lt;/footer&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is what the site looks like without inheritance, with only a single html-file:</p>
  
  <p><a href="http://i.stack.imgur.com/yent4.jpg" rel="nofollow">good layout</a></p>
  
  <p>And here's how it looks with inheritance. Notice the space above the navbar, and the squashed search field:</p>
  
  <p><a href="http://i.stack.imgur.com/NXpar.jpg" rel="nofollow">bad layout</a></p>
  
  <p>When i used only the base css, it looked fine, but even when i used an empty template to inherit:</p>
  
  <pre><code>{% extends "base.html" %}
  {% block content %}
  {% endblock %}
  </code></pre>
  
  <p>The  white space was still there.</p>
  
  <p>Is there something wrong with the HTML, or is it a bug in Django? How can i fix/circumvent it?</p>
  
  <p>edit: Here is the entire base html-file:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;    
  &lt;html lang="en"&gt;    
    &lt;head&gt;    
      &lt;meta charset="utf-8"&gt;    
      &lt;title&gt;Biblio&lt;/title&gt;    
      &lt;meta name="description" content=""&gt;    
      &lt;meta name="author" content=""&gt;    
      &lt;!--[if lt IE 9]&gt;    
        &lt;script src="http://html5shim.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;    
      &lt;![endif]--&gt;    
      &lt;link href="/static/css/bootstrap.css" rel="stylesheet"&gt;    
      &lt;link href="/static/css/bootstrap-responsive.css" rel="stylesheet"&gt;    
    &lt;/head&gt;    
  
    &lt;body&gt;    
      &lt;div class="navbar"&gt;    
          &lt;div class="navbar-inner"&gt;    
              &lt;div class="container"&gt;    
                  &lt;ul class="nav pull-left"&gt;    
                      &lt;a class="brand" href="#"&gt;Test-test&lt;/a&gt;    
                  &lt;/ul&gt;    
                  &lt;ul class="nav"&gt;    
                      &lt;li class="active"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;    
                      &lt;li&gt;&lt;a href="/about/"&gt;Din profil&lt;/a&gt;&lt;/li&gt;    
                      &lt;li&gt;&lt;a href="/contact/"&gt;Dina böcker&lt;/a&gt;&lt;/li&gt;    
                      &lt;li&gt;&lt;a href="/contact/"&gt;Lägg till bok&lt;/a&gt;&lt;/li&gt;    
                      &lt;li class="divider-vertical align-left"&gt;&lt;/li&gt;    
                      &lt;li&gt;    
                          &lt;form class="navbar-search" name="input" action="." method="get"&gt;    
                              &lt;input type="text" class="search-query" name="search" placeholder="Sök böcker/användare" &gt;    
                          &lt;/form&gt;    
                      &lt;/li&gt;    
                  &lt;/ul&gt;    
                  &lt;ul class="nav pull-right"&gt;    
                      &lt;li class="divider-vertical align-left"&gt;&lt;/li&gt;    
                      &lt;li class="dropdown"&gt;    
                          &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt;    
                              Logga in    
                              &lt;b class="caret"&gt;&lt;/b&gt;    
                          &lt;/a&gt;    
                          &lt;ul class="dropdown-menu"&gt;    
                              &lt;form name="input" action="/login/" method="post"&gt;    
                                  &lt;p&gt;&lt;label for="id_username"&gt;Username:&lt;/label&gt; &lt;input id="id_username" class="input" type="text" name="username" maxlength="30" /&gt;&lt;/p&gt;    
                                  &lt;p&gt;&lt;label for="id_password"&gt;Password:&lt;/label&gt; &lt;input type="password" name="password" id="id_password" /&gt;&lt;/p&gt;    
                                  &lt;input type="submit" value="Logga in" /&gt;    
                              &lt;/form&gt;    
                          &lt;/ul&gt;    
                      &lt;/li&gt;    
                  &lt;/ul&gt;    
              &lt;/div&gt;    
          &lt;/div&gt;    
      &lt;/div&gt;    
  
          &lt;div class="span5"&gt;    
              {% if uname %}    
                  Välkommen, {{ uname }}    
              {% else %}    
                  Logga in!    
              {% endif %}    
          &lt;/div&gt;    
  
      &lt;div class="container"&gt;    
      {% block content %} {% endblock %}    
      &lt;footer&gt;    
          &lt;p&gt;Designad och skapad av Johan Rende, jrende@kth.se, 2012&lt;/p&gt;    
      &lt;/footer&gt;    
      &lt;/div&gt; &lt;!-- /container --&gt;    
  
      &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt;    
      &lt;script src="../static/js/bootstrap-dropdown.js"&gt;&lt;/script&gt;    
    &lt;/body&gt;    
  &lt;/html&gt;    
  </code></pre>