title: Whitespace changes layout in Chrome?
body: <p>I was having a curious problem that I finally found a solution to, but I'm not sure why it happens. I have a page that is being generated by PHP, so the resulting HTML is not always nicely formatted. Here's the relevant code:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;style&gt;
              body {background-color: #99ccff;}
              div#content {
                  margin: 0 auto;
                  text-align: center;
              }
              div#results_header {
                  background-color: white;
                  display: inline-block;
                  font-family: sans-serif;
                  font-size: 12px;
                  margin: 5px 9px 0;
                  padding-left: 18px;
                  padding-top: 5px;
                  text-align: left;
                  border-bottom: 1px solid;
              }
              div.header {
                  display: inline-block;
                  font-weight: bold;
                  padding-bottom: 5px;
              }
              div#ships {
                  background-color: white;
                  display: inline-block;
                  font-family: sans-serif;
                  font-size: 12px;
                  height: 180px;
                  margin: 0 9px 9px;
                  overflow-y: auto;
                  padding-left: 18px;
                  text-align: left;
              }
              div.status {width: 10px;}
              div.name {width: 260px;}
              div.flag {width: 40px;}
              div.type {width: 50px;}
              div.sconum {width: 70px;}
              div.call_sign {width: 80px;}
              div.imo_number {width: 70px;}
              div.upseq {width: 140px;}
              div.photo {width: 50px;}
              div.my_photo {width: 50px;}
          &lt;/style&gt; 
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="content" style="width: 880px;"&gt;
              &lt;div id="results_header" style="width: 840px;"&gt;
                  &lt;div class="name header"&gt;Name&lt;/div&gt;
                  &lt;div class="flag header"&gt;Flag&lt;/div&gt;
                  &lt;div class="type header"&gt;Type&lt;/div&gt;
                  &lt;div class="sconum header"&gt;SCONUM&lt;/div&gt;
                  &lt;div class="call_sign header"&gt;Call Sign&lt;/div&gt;
                  &lt;div class="imo_number header"&gt;IMO #&lt;/div&gt;
                  &lt;div class="upseq header"&gt;UPSEQ&lt;/div&gt;
                  &lt;div class="photo header"&gt;Photo&lt;/div&gt;
                  &lt;div class="my_photo header"&gt;My Photo&lt;/div&gt;
              &lt;/div&gt;
              &lt;div id="ships" style="width: 840px;"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I formatted it for readability (the CSS is actually in an external file, for instance). The page is actually generated by PHP so it doesn't look nearly as pretty as this. Therein lies the problem. What I posted above displays fine and consistent in all browsers. When I remove the whitespace before the "ships" div, it is misaligned in Chrome (Firefox looks fine, haven't had a chance to test in IE yet).</p>
  
  <pre><code>    &lt;body&gt;
          &lt;div id="content" style="width: 880px;"&gt;
              &lt;div id="results_header" style="width: 840px;"&gt;
                  &lt;div class="name header"&gt;Name&lt;/div&gt;
                  &lt;div class="flag header"&gt;Flag&lt;/div&gt;
                  &lt;div class="type header"&gt;Type&lt;/div&gt;
                  &lt;div class="sconum header"&gt;SCONUM&lt;/div&gt;
                  &lt;div class="call_sign header"&gt;Call Sign&lt;/div&gt;
                  &lt;div class="imo_number header"&gt;IMO #&lt;/div&gt;
                  &lt;div class="upseq header"&gt;UPSEQ&lt;/div&gt;
                  &lt;div class="photo header"&gt;Photo&lt;/div&gt;
                  &lt;div class="my_photo header"&gt;My Photo&lt;/div&gt;
              &lt;/div&gt;
  &lt;div id="ships" style="width: 840px;"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Again, easily fixed, but I'm curious why this is happening at all.</p>