title: IE7 margin issue
body: <p>and thanks for the help.</p>
  
  <p>I am having a somewhat confusing issue with IE7 when using margins.</p>
  
  <p>I have a contaner, and inside that container I have some floated boxes.</p>
  
  <p>These boxes have margins applied, top, right, left, bottom, except the first box that has no margin on the left, and the last box that has no margin on the right.</p>
  
  <p>Looks fine in all browsers except IE7, where the margin is not applying for the first element in each row (at least this is what I think is happening.</p>
  
  <p>If I remove margin right in ie7 using the dev tools and then check it back on it displays correctly.</p>
  
  <p>Has anyone seen anything like this before?</p>
  
  <p>I am stumped.</p>
  
  <p><strong><em>EDIT</em></strong>
  It appears to being caused by position:relative on the container divs. Changing this back to static fixes the margin issue, but now means my divs are mis aligned in ie7. Does anyone know why position relative would screw up margins??</p>
  
  <p><strong><em>NEW EDIT</em></strong>
  Example download can be found here:
  www.jimplode.co.uk/content/stackoverflow.zip</p>
  
  <p>Incorrect view
  <img src="https://i.stack.imgur.com/9Pizq.png" alt="Incorrect"></p>
  
  <p>Correct Margins, after unchecking and rechecking just one of the margin styles.
  <img src="https://i.stack.imgur.com/oySYZ.png" alt="Correct"></p>
  
  <p><strong>The HTML:</strong></p>
  
  <pre><code>&lt;div class="lowerContent"&gt;
      &lt;div class="mediumContentBox contentBoxMarginTop contentBoxMarginRight contentBoxMarginBottom"&gt;
  
                              &lt;div class="expandableBox"&gt;
                                  &lt;div class="topLeft"&gt;
                                      &lt;div class="topRight"&gt;
                                          &lt;div class="top"&gt;&lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="middleLeft"&gt;
                                      &lt;div class="middleRight"&gt;
                                          &lt;div class="middle"&gt;
                                              &lt;img src="/images/frame/transparent.gif" alt="spacer"width="0" height="215" class="fl" /&gt;
                                              &lt;div class="textContainer"&gt;
                                                  &lt;h1&gt;Car Insurance&lt;/h1&gt;
                                                  &lt;ul&gt;
                                                      &lt;li&gt;Protected NCD for life&lt;/li&gt;
                                                      &lt;li&gt;NCD Accelerator&lt;/li&gt;
                                                      &lt;li&gt;European Cover Included&lt;/li&gt;
                                                      &lt;li&gt;Multiple Drivers and Vehicles&lt;/li&gt;
                                                      &lt;li&gt;Breakdown Cover Included&lt;/li&gt;
                                                      &lt;li&gt;Legal Cover Included&lt;/li&gt;
                                                  &lt;/ul&gt;
                                                  &lt;div class="boxButtons"&gt;
                                                      &lt;a class="smallButtonLeft" href="#"&gt;&lt;span&gt;GET A QUOTE&lt;/span&gt;&lt;/a&gt;&lt;a class="smallButtonRight" href="#"&gt;&lt;span&gt;FIND OUT MORE&lt;/span&gt;&lt;/a&gt;
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
                                              &lt;div class="imageContainer"&gt;
                                                  &lt;img src="/images/misc/boxphoto_1.jpg" alt="box image 0" /&gt;
                                              &lt;/div&gt;
                                              &lt;div class="emptyClear"&gt;&lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="bottomLeft"&gt;
                                      &lt;div class="bottomRight"&gt;
                                          &lt;div class="bottom"&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="smallContentBox contentBoxMarginTop contentBoxMarginLeft contentBoxMarginRight contentBoxMarginBottom"&gt;
  
                              &lt;div class="expandableBox"&gt;
                                  &lt;div class="topLeft"&gt;
                                      &lt;div class="topRight"&gt;
                                          &lt;div class="top"&gt;&lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="middleLeft"&gt;
                                      &lt;div class="middleRight"&gt;
                                          &lt;div class="middle"&gt;
                                              &lt;img src="/images/frame/transparent.gif" alt="spacer"width="0" height="215" class="fl" /&gt;
                                              &lt;div class="textContainer"&gt;
                                                  &lt;h2&gt;Home Insurance&lt;/h2&gt;
                                                  &lt;div class="imageContainer"&gt;
                                                      &lt;img src="/images/misc/boxphoto_2.jpg" alt="box image 2" /&gt;
                                                  &lt;/div&gt;
                                                  &lt;ul&gt;
                                                      &lt;li&gt;Working at home Equipment&lt;/li&gt;
                                                      &lt;li&gt;Helmet and Leathers&lt;/li&gt;
                                                      &lt;li&gt;Legal Cover&lt;/li&gt;
                                                      &lt;li&gt;Caravan Cover&lt;/li&gt;
                                                      &lt;li&gt;Personal Accident Cover&lt;/li&gt;
                                                  &lt;/ul&gt;
                                                  &lt;div class="boxButtons"&gt;
                                                      &lt;a class="smallButtonLeft" href="#"&gt;&lt;span&gt;GET A QUOTE&lt;/span&gt;&lt;/a&gt;&lt;a class="smallButtonRight" href="#"&gt;&lt;span&gt;FIND OUT MORE&lt;/span&gt;&lt;/a&gt;
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
                                              &lt;div class="emptyClear"&gt;&lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="bottomLeft"&gt;
                                      &lt;div class="bottomRight"&gt;
                                          &lt;div class="bottom"&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="smallContentBox contentBoxMarginTop contentBoxMarginLeft contentBoxMarginBottom"&gt;
  
                              &lt;div class="expandableBox"&gt;
                                  &lt;div class="topLeft"&gt;
                                      &lt;div class="topRight"&gt;
                                          &lt;div class="top"&gt;&lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="middleLeft"&gt;
                                      &lt;div class="middleRight"&gt;
                                          &lt;div class="middle"&gt;
                                              &lt;img src="/images/frame/transparent.gif" alt="spacer"width="0" height="215" class="fl" /&gt;
                                              &lt;div class="textContainer"&gt;
                                                  &lt;h2&gt;Life Insurance&lt;/h2&gt;
                                                  &lt;div class="imageContainer"&gt;
                                                      &lt;img src="/images/misc/boxphoto_3.jpg" alt="box image 3" /&gt;
                                                  &lt;/div&gt;
                                                  &lt;ul&gt;
                                                      &lt;li&gt;Cover From &amp;pound;5 a month&lt;/li&gt;
                                                      &lt;li&gt;Your loved ones protected&lt;/li&gt;
                                                      &lt;li&gt;Immediate cover available&lt;/li&gt;
                                                      &lt;li&gt;We search, you save&lt;/li&gt;
                                                  &lt;/ul&gt;
                                                  &lt;div class="boxButtons"&gt;
                                                      &lt;a class="smallButtonLeft" href="#"&gt;&lt;span&gt;GET A QUOTE&lt;/span&gt;&lt;/a&gt;&lt;a class="smallButtonRight" href="#"&gt;&lt;span&gt;FIND OUT MORE&lt;/span&gt;&lt;/a&gt;
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
                                              &lt;div class="emptyClear"&gt;&lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="bottomLeft"&gt;
                                      &lt;div class="bottomRight"&gt;
                                          &lt;div class="bottom"&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                      &lt;/div&gt;
                      &lt;div class="emptyClear"&gt;&lt;/div&gt;
  
                      &lt;div class="smallContentBox contentBoxMarginTop contentBoxMarginRight"&gt;
  
                              &lt;div class="expandableBox"&gt;
                                  &lt;div class="topLeft"&gt;
                                      &lt;div class="topRight"&gt;
                                          &lt;div class="top"&gt;&lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="middleLeft"&gt;
                                      &lt;div class="middleRight"&gt;
                                          &lt;div class="middle"&gt;
                                              &lt;img src="/images/frame/transparent.gif" alt="spacer"width="0" height="140" class="fl" /&gt;
                                              &lt;div class="imageContainerAlternate"&gt;
                                                  &lt;img src="/images/misc/boxphoto_4.jpg" alt="box image 4" /&gt;
                                              &lt;/div&gt;   
                                              &lt;div class="boxButtons"&gt;
                                                  &lt;a class="smallButtonLeft" href="#"&gt;&lt;span&gt;GET A QUOTE&lt;/span&gt;&lt;/a&gt;&lt;a class="smallButtonRight" href="#"&gt;&lt;span&gt;FIND OUT MORE&lt;/span&gt;&lt;/a&gt;
                                              &lt;/div&gt;
                                              &lt;div class="emptyClear"&gt;&lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="bottomLeft"&gt;
                                      &lt;div class="bottomRight"&gt;
                                          &lt;div class="bottom"&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="smallContentBox contentBoxMarginTop contentBoxMarginRight contentBoxMarginLeft"&gt;
  
                              &lt;div class="expandableBox"&gt;
                                  &lt;div class="topLeft"&gt;
                                      &lt;div class="topRight"&gt;
                                          &lt;div class="top"&gt;&lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="middleLeft"&gt;
                                      &lt;div class="middleRight"&gt;
                                          &lt;div class="middle"&gt;
                                              &lt;img src="/images/frame/transparent.gif" alt="spacer"width="0" height="140" class="fl" /&gt;
                                              &lt;div class="imageContainerAlternate"&gt;
                                                  &lt;img src="/images/misc/boxphoto_5.jpg" alt="box image 5" /&gt;
                                              &lt;/div&gt; 
                                              &lt;div class="boxButtons"&gt;
                                                  &lt;a class="smallButtonLeft" href="#"&gt;&lt;span&gt;GET A QUOTE&lt;/span&gt;&lt;/a&gt;&lt;a class="smallButtonRight" href="#"&gt;&lt;span&gt;FIND OUT MORE&lt;/span&gt;&lt;/a&gt;
                                              &lt;/div&gt;
                                              &lt;div class="emptyClear"&gt;&lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="bottomLeft"&gt;
                                      &lt;div class="bottomRight"&gt;
                                          &lt;div class="bottom"&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="smallContentBox contentBoxMarginTop contentBoxMarginRight contentBoxMarginLeft"&gt;
  
                              &lt;div class="expandableBox"&gt;
                                  &lt;div class="topLeft"&gt;
                                      &lt;div class="topRight"&gt;
                                          &lt;div class="top"&gt;&lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="middleLeft"&gt;
                                      &lt;div class="middleRight"&gt;
                                          &lt;div class="middle"&gt;
                                              &lt;img src="/images/frame/transparent.gif" alt="spacer"width="0" height="140" class="fl" /&gt;
                                              &lt;div class="imageContainerAlternate"&gt;
                                                  &lt;img src="/images/misc/boxphoto_6.jpg" alt="box image 6" /&gt;
                                              &lt;/div&gt; 
                                              &lt;div class="boxButtons"&gt;
                                                  &lt;a class="smallButtonLeft" href="#"&gt;&lt;span&gt;GET A QUOTE&lt;/span&gt;&lt;/a&gt;&lt;a class="smallButtonRight" href="#"&gt;&lt;span&gt;FIND OUT MORE&lt;/span&gt;&lt;/a&gt;
                                              &lt;/div&gt;
                                              &lt;div class="emptyClear"&gt;&lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="bottomLeft"&gt;
                                      &lt;div class="bottomRight"&gt;
                                          &lt;div class="bottom"&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="smallContentBox contentBoxMarginTop contentBoxMarginLeft"&gt;
  
                              &lt;div class="expandableBox"&gt;
                                  &lt;div class="topLeft"&gt;
                                      &lt;div class="topRight"&gt;
                                          &lt;div class="top"&gt;&lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="middleLeft"&gt;
                                      &lt;div class="middleRight"&gt;
                                          &lt;div class="middle"&gt;
                                              &lt;img src="/images/frame/transparent.gif" alt="spacer"width="0" height="140" class="fl" /&gt;
                                              &lt;div class="imageContainerAlternate"&gt;
                                                  &lt;img src="/images/misc/boxphoto_7.jpg" alt="box image 7" /&gt;
                                              &lt;/div&gt; 
                                              &lt;div class="boxButtons"&gt;
                                                  &lt;a class="smallButtonLeft" href="#"&gt;&lt;span&gt;GET A QUOTE&lt;/span&gt;&lt;/a&gt;&lt;a class="smallButtonRight" href="#"&gt;&lt;span&gt;FIND OUT MORE&lt;/span&gt;&lt;/a&gt;
                                              &lt;/div&gt;
                                              &lt;div class="emptyClear"&gt;&lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="bottomLeft"&gt;
                                      &lt;div class="bottomRight"&gt;
                                          &lt;div class="bottom"&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                      &lt;/div&gt;
                      &lt;div class="emptyClear"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>The CSS:</strong></p>
  
  <pre><code>    .lowerContent
      {
          position:relative;
          margin:0px 0px 0px 0px;
      }
  
      .expandableBox
      {
          display:block;
          width:100%;
      }
  
      .expandableBox .top
      {
          background-image:url("/images/backgrounds/bkg_whitebox_t.png");
          background-repeat: repeat-x;
          height:10px;
      }
  
      .expandableBox .topLeft
      {
          height:10px;
          padding:0px 0px 0px 10px;
          background-image:url("/images/backgrounds/bkg_whitebox_tl.png");
          background-repeat: no-repeat;
          background-position:left top;
      }
  
      .expandableBox .topRight
      {
          height:10px;
          padding:0px 10px 0px 0px;
          background-image:url("/images/backgrounds/bkg_whitebox_tr.png");
          background-repeat: no-repeat;
          background-position:right top;
      }
  
      .expandableBox .middleLeft
      { 
          padding:0px 0px 0px 10px;
          background-image:url("/images/backgrounds/bkg_whitebox_l.png");
          background-repeat: repeat-y;
          background-position:left top;
      }
  
      .expandableBox .middle
      { 
          background-color:#FFFFFF;
      }
  
      .expandableBox .middleRight
      {     
          padding:0px 10px 0px 0px;
          background-image:url("/images/backgrounds/bkg_whitebox_r.png");
          background-repeat: repeat-y;
          background-position:right top;
      }
  
      .expandableBox .bottom
      {
          background-image:url("/images/backgrounds/bkg_whitebox_b.png");
          background-repeat: repeat-x;    
          background-position:bottom;
          height:10px;
          margin-bottom:7px;
      }
  
      .expandableBox .bottomLeft
      {
          height:10px;
          padding:0px 0px 0px 10px;
          background-image:url("/images/backgrounds/bkg_whitebox_bl.png");
          background-repeat: no-repeat;
          background-position:left bottom;
      }
  
      .expandableBox .bottomRight
      {
          height:10px;
          padding:0px 10px 0px 0px;
          background-image:url("/images/backgrounds/bkg_whitebox_br.png");
          background-repeat: no-repeat;
          background-position:right bottom;
      }
  
  
  
  
      .contentBoxMarginLeft
      {
          margin-left:10px;
      }
  
      .contentBoxMarginRight
      {
          margin-right:10px;
      }
  
      .contentBoxMarginTop
      {
          margin-top:10px;
      }
  
      .contentBoxMarginBottom
      {
          margin-bottom:10px;
      }
  .fullContentBox
  {
      width:940px;
      float:left;
  }
  
  .largeContentBox
  {
      width:700px;
      float:left;
  }
  
  .mediumContentBox
  {
      width:460px;
      float:left;
  }
  
  .smallContentBox
  {
      width:220px;
      float:left;
  }
  
  
  .mediumContentBox .textContainer
  {
      float:left;
      width:210px;
  }
  
  .mediumContentBox .imageContainer
  {
      float:right;
      width:210px;
  }
  
  
  .smallContentBox .textContainer
  {
  }
  
  .smallContentBox .textContainer .imageContainer
  {
      float:right;
      padding:5px 0px 0px 0px;
  }
  
  .smallContentBox .imageContainerAlternate
  {
      float:left;
      padding:0px 0px 0px 0px;
  }
  
  a.smallButtonLeft,
  a.smallButtonRight
  {
      display:inline-block;
      background-image:url('/images/backgrounds/bkg_sprites_buttons.png');
      height:30px;
      background-position:left top;
      background-repeat:no-repeat;
      padding:0px 10px;
      line-height:23px;
      color: #0F4DBC;
      font-family: Arial,Helvetica,sans-serif;
      font-weight: bold;
      text-decoration: none;
      text-transform: capitalize;
  }
  a.smallButtonLeft:hover
  {
      background-position:left -44px;
  }
  
  a.smallButtonRight
  {
      background-position:right -217px;
      color: #4D4F52;
  }
  a.smallButtonRight:hover
  {
      background-position:right -262px;
  }
  
  
  .boxButtons
  {
      float:left;
      padding:10px 0px 0px 0px;
  }
  
  .smallContentBox .boxButtons
  {
      width:200px;
      text-align:center;
  }
  </code></pre>
  
  <p>Thanks in advance.</p>