title: how have two parent div next to each other
body: <p>I'm working on a css/html site and I have this problem: in my style.css I got two divs, one for sidebar and one for content. I would like the sidebar to be, well, at the side, but when both are present the content always goes below the sidebar, unless I put that in position:absolute. In that case I have a problem when small screens are used, 'cause they get one over the other.</p>
  
  <p>I paste the code, hope you can help!</p>
  
  <pre><code>/* This is for content */
  article, aside, figure, footer, header, hgroup, menu, nav, section {
      display: block;
  }
  
  #modal {    
      position: relative;
      width: 100%;
      display: inline-block; 
      display: table; 
      display: table-cell;
      float: none;
      border: 1px solid #CCC;
      box-shadow: 0 1px 5px #CCC;
      border-radius: 5px;
      font-family: verdana;
      margin: 25px auto;
      text align: center;
      background-color: #f2f2f2;
      overflow: auto;
  }
  
  #modal header {
      background: #f1f1f1;
      background-image: -webkit-linear-gradient( top, #f1f1f1, #CCC );
      background-image: -ms-linear-gradient( top, #f1f1f1, #CCC );
      background-image: -moz-linear-gradient( top, #f1f1f1, #CCC );
      background-image: -o-linear-gradient( top, #f1f1f1, #CCC );
      box-shadow: 0 1px 2px #888;
      padding: 10px;
  }
  
  #modal h1 {
      padding: 0;
      margin: 0;
      font-size: 16px;
      font-weight: normal;
      text-shadow: 0 1px 2px white;
      color: #323232;
      text-align: center;
  }
  
  #modal section {
      padding-right: 10px;
      padding-left: 10px;
      padding-bottom: 10px; 
      font-size: 12px;
      line-height: 175%;
      color: #333;
      text-align: center;
  }
  </code></pre>
  
  <p>while this is the sidebar</p>
  
  <pre><code>/*sidebar */
  #sidebar{
      position: static;
      margin-top: 15px;
      max-width: 150px;
  }
  
  #sidebar ul,
  #sidebar ul li,
  #sidebar ul ul {
      list-style: none;
      margin: 0;
      padding: 0;
      border: 0;
      top: 5%;
  }
  
  #sidebar ul {
      position: static;
      top: 90px;
      z-index: 1000;
  }
  
  #sidebar ul li {
      min-height: 1px;
      line-height: 1em;
      vertical-align: middle;
  }
  
  #sidebar ul li.hover,
  #sidebar ul li:hover {
      position: relative;
      z-index: 599;
      cursor: default;
  }
  
  #sidebar ul ul {
      margin-top: 1px;
      visibility: hidden;
      position: absolute;
      top: 1px;
      left: 99%;
      z-index: 598;
      width: 100%;
  }
  
  #sidebar ul ul li {
      float: none;
  }
  
  #sidebar ul ul ul {
      top: 1px;
      left: 99%;
  }
  
  #sidebar ul li:hover &gt; ul {
      visibility: visible;
  }
  
  #sidebar ul li {
      float: none;
  }
  
  #sidebar ul ul li {
      font-weight: normal;
  }
  
  /* Custom CSS Styles */
  #sidebar {
      font-family: 'Lato', sans-serif;
      font-size: 18px;
      width: 180px;
  }
  
  #sidebar ul a,
  #sidebar ul a:link,
  #sidebar ul a:visited {
      display: block;
      color: #000000;
      text-decoration: none;
      font-weight: 300;
  }
  
  #sidebar &gt; ul {
      float: none;
  }
  
  #sidebar ul {
      background: #a0a0a0;
  }
  
  #sidebar &gt; ul &gt; li {
      border-left: 3px solid #000000;
  }
  
  #sidebar &gt; ul &gt; li &gt; a {
      padding: 10px 20px;
  }
  
  #sidebar &gt; ul &gt; li:hover {
      border-left: 3px solid #9b1a1c;
  }
  
  #sidebar ul li:hover &gt; a {
      color: #9b1a1c;
  }
  
  #sidebar &gt; ul &gt; li:hover {
      background: #f6f6f6;
  }
  
  /* Sub Menu */
  #sidebar ul ul a:link,
  #sidebar ul ul a:visited {
      font-weight: 400;
      font-size: 14px;
  }
  
  #sidebar ul ul {
      width: 180px;
      background: none;
      border-left: 20px solid transparent;
  }
  
  #sidebar ul ul a {
      padding: 8px 0;
      border-bottom: 1px solid #eeeeee;
  }
  
  #sidebar ul ul li {
      padding: 0 20px;
      background: #fff;
  }
  
  #sidebar ul ul li:last-child {
      border-bottom: 3px solid #000000;
      padding-bottom: 10px;
  }
  
  #sidebar ul ul li:first-child {
      padding-top: 10px;
  }
  
  #sidebar ul ul li:last-child &gt; a {
      border-bottom: none;
  }
  
  #sidebar ul ul li:first-child:after {
      content: '';
      display: block;
      width: 0;
      height: 0;
      position: absolute;
      left: -20px;
      top: 13px;
      border-left: 10px solid transparent;
      border-right: 10px solid #fff;
      border-bottom: 10px solid transparent;
      border-top: 10px solid transparent;
  }
  </code></pre>