title: CSS: Placing divs left/center/right inside header
body: <p>I've been trying to create a site with the following structure:<br>
  <a href="https://i.stack.imgur.com/HF0eJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HF0eJ.png" alt="desired structure"></a>
  </p>
  
  <p>But I can't seem to get the header correct (e1 left, e2 centered, e3 right). I want the three elements e1, e2 and e3 to be left, middle and right positioned. This is what I'm trying:  </p>
  
  <pre><code>&lt;div id="wrapper"&gt;
  &lt;div id="header"&gt;
      &lt;div id="header-e1"&gt;
          1
      &lt;/div&gt;
      &lt;div id="header-e2"&gt;
          2
      &lt;/div&gt;
      &lt;div id="header-e3"&gt;
          3
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="nav"&gt;
      links
  &lt;/div&gt;
  &lt;div id="content"&gt;
      content
  &lt;/div&gt;
  &lt;div id="footer"&gt;
      footer
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>With this css:  </p>
  
  <pre><code>#wrapper
  {
      width: 95%;
      margin: 20px auto;
      border: 1px solid black;
  }
  
  #header
  {
      margin: 5px;
  }
  #header-e1
  {
      float: left;
      border: 1px solid black;
  }
  #header-e2
  {
      float: left;
      border: 1px solid black;
  }
  #header-e3
  {
  
      border: 1px solid black;
  }
  
  #nav
  {
      margin: 5px;
  }
  #content
  {
      margin: 5px;
  }
  #footer
  {
      margin: 5px;
  }
  </code></pre>
  
  <h2>Can someone give me tips to what I can do? The structure is going to be used on a mobile website.</h2>
  
  <p>UPDATE</p>
  
  <p>The code I have above gives me this: 
  <a href="https://i.stack.imgur.com/5347B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5347B.png" alt="current result"></a>
  
  But I want the 2 centered and the 3 on the right side. I don't want to set the width to a percent because the content in the elements may vary, meaning it may be 20/60/20 - 10/80/10 - 33/33/33 or something else.</p>