title: Why does a div spill out of the parent wrapper in HTML
body: <p>I don't seem to position a div as I want it be. The basic structure of my HTML is</p>
  
  <pre><code>    Header
      main{
           nav// top strip
           #leftContain  //left half-bar
           #rigthContain //right half-bar:**this one spills out**
           }
      footer
  </code></pre>
  
  <p>Here is the HTML minus the CSS link(not relavent as the relevant ones I have kept inline here)and minus the HTML tag/metatag/head tag/javascript tags)Also the images references doesn't make any difference so I ignored those too</p>
  
  <pre><code> &lt;body&gt;
      &lt;header style="width:1020px;margin:0 auto"&gt;
          &lt;h1&gt;Company logo&lt;/h1&gt;
       &lt;/header&gt;
      &lt;main id="wrapper" style="width:1020px;margin:0 auto"&gt;
  
  
       &lt;nav style="  line-height:30px; background-color:#ff0000;height:30px;width:100%;"&gt;
       &lt;p style="font-family: '21st Century', fantasy"&gt;
       &lt;a href=""&gt;products + Solutions&lt;/a&gt; 
       &lt;a href=""&gt;Services&lt;/a&gt;
       &lt;a href=""&gt;industries&lt;/a&gt;
       &lt;a href=""&gt;resources&lt;/a&gt;
       &lt;a href=""&gt;company&lt;/a&gt;
       &lt;a href=""&gt;investors&lt;/a&gt;
       &lt;a href=""&gt;Careers&lt;/a&gt;
       &lt;/p&gt;
       &lt;/nav&gt;
  
           &lt;div id="leftContain" style="width:500px"&gt;
               &lt;section id="headContent"&gt;
               &lt;p style="color:red;font-size:44px;margin-top:17px;margin-bottom:10px;line-height: 110%;"&gt;See how our engineer perfectly matched their DNA
               &lt;/p&gt;
               &lt;p style="margin-top:2px;line-height: 120%;"&gt;
               Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. 
               &lt;/p&gt;
               &lt;/section&gt;
               &lt;hr&gt;
  
               &lt;section class="picTile" style="width:550px;height:170px;overflow:hidden"&gt;
                  &lt;img src="assets/images/item1.jpg" style="width:250px;float:left"&gt;
                  &lt;div style="width:250px;float:left"&gt;
                      &lt;p style="margin-top:0;margin-left:4px;line-height: 90%;line-height: 120%;"&gt; Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec.
                      &lt;/p&gt;
                  &lt;/div&gt;
               &lt;/section&gt;
               &lt;hr&gt;
  
               &lt;section class="picTile" style="width:550px;height:170px;overflow:hidden"&gt;
                  &lt;img src="assets/images/item2.jpg" style="width:250px;float:left"&gt;
                  &lt;div style="width:250px;float:left"&gt;
                      &lt;p style="margin-top:0;margin-left:4px;line-height: 120%;"&gt; Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec.
                      &lt;/p&gt;
                  &lt;/div&gt;
               &lt;/section&gt;
               &lt;hr&gt;
  
  
               &lt;section class="picTile" style="width:550px;height:170px;margin-bottom:10px;overflow:hidden"&gt;
                  &lt;img src="assets/images/item3.jpg" style="width:250px;float:left"&gt;
                  &lt;div style="width:250px;float:left"&gt;
                      &lt;p style="margin-top:0;margin-left:4px;line-height: 120%;"&gt; Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec.
                      &lt;/p&gt;
                  &lt;/div&gt;  
               &lt;/section&gt;
              &lt;hr&gt;
           &lt;/div&gt;
  
           &lt;div id="RightContain" style="width:500px;float:left" &gt;
              &lt;section id="banner;" style="float:left;width:200px"&gt;
              #banner
                  &lt;img src="assets/images/dr_left_slideshow.svg"&gt;
              &lt;/section&gt;
              &lt;section id="contactForm"&gt;
              &lt;/section&gt;
           &lt;/div&gt;
  
  
  
      &lt;/main&gt;
      &lt;footer style=" position:relative;bottom:0;width:100%;height:60px;"&gt;
       &lt;p&gt;Privacy policy +terms of use | C 2014&lt;/p&gt;
      &lt;/footer&gt;
  
  
    &lt;/body&gt;
  </code></pre>
  
  <p>I want the #rightContain and #leftContain div to be besides each other,but it doesn't happen so ,the #rightContain slips out of the wrapping main div and goes to the bottom of the screen</p>