title: CSS Differences Between IE and Firefox: display
body: <p>I am developing a web application which needs to work with both IE7 and Firefox 3.6.  I am laying out the forms using CSS.  The forms are pretty standard.  I want each div (data-group) on its own line with the labels and options lined up together within the div (as a row).  Here is the CSS that works in Firefox:</p>
  
  <pre><code>.data-group 
  {
      /*display: inline-block;*/
      vertical-align: top;
      padding-top: 5px;
      padding-bottom: 5px;
  }
  
  .editor-label, .option1, .option2
  {
      display: inline-block;
      /*float: left;*/
  }
  
  .editor-label
  {
      width: 250px;
      vertical-align: top;
  }
  </code></pre>
  
  <p>Unfortunately, this does not work in IE7.  To achieve the same effect, I have to uncomment the two commented lines and comment the inline-block on .editor-label, .option1, .option2 selection.  Unfortunately this breaks Firefox...and this really does not seem like the correct thing to do anyway (the Firefox way makes far more sense).  (I can get this way to work in Firefox if I add a "clear" div where I have "clear: both" on that div's class...but this seems like a hack.)</p>
  
  <p>Am I missing something obvious here?  Suggestions to help make this work in both browsers would be great.</p>
  
  <p><strong>Edit: Provide requested (trivialized) HTML.</strong></p>
  
  <pre><code>    &lt;div class="data-group"&gt;
          &lt;div class="editor-label"&gt;
              &lt;%: Html.CheckBoxFor(model =&gt; model.cb1)%&gt;
              &lt;%: Html.LabelFor(model =&gt; model.label1) %&gt;
          &lt;/div&gt;
          &lt;div class="option1"&gt;
              &lt;%: Html.TextBoxFor(model =&gt; model.tb2)%&gt;
              &lt;div class="label"&gt;&lt;%: Html.LabelFor(model =&gt; model.label2) %&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="validation"&gt;
              &lt;div&gt;&lt;%: Html.ValidationMessageFor(model =&gt; model.tb2) %&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;!-- Repeat many diff. data-groups. --&gt;
      &lt;div class="data-group"&gt;
          &lt;div class="editor-label"&gt;
              &lt;%: Html.CheckBoxFor(model =&gt; model.cb1)%&gt;
              &lt;%: Html.LabelFor(model =&gt; model.label1) %&gt;
          &lt;/div&gt;
          &lt;div class="option1"&gt;
              &lt;%: Html.TextBoxFor(model =&gt; model.tb2)%&gt;
              &lt;div class="label"&gt;&lt;%: Html.LabelFor(model =&gt; model.label2) %&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="validation"&gt;
              &lt;div&gt;&lt;%: Html.ValidationMessageFor(model =&gt; model.tb2) %&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>