title: how to use display flex instead of float left and float right
body: <p>How to use display <code>flex</code> instead of <code>float: left</code> and <code>float: right</code>?</p>
  
  <p><strong>See below image</strong></p>
  
  <p><a href="https://i.stack.imgur.com/4gPGN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4gPGN.png" alt="enter image description here"></a></p>
  
  <p>I tried like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    padding: 0;
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
  }
  
  a {
    text-underline: none;
  }
  
  .bg {
    background: #eee;
  }
  
  .header {
    display: flex;
    background: #af2c2c;
  }
  
  .logo h2 {
    color: #fff;
    font-family: "Times New Roman", Times, serif
  }
  
  .menu_hang {
    background-position: -70px -92px;
    background-image: url(https://static.toiimg.com/photo/52121907.cms);
    background-size: 200px;
    width: 30px;
    height: 24px;
    opacity: .8;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Title&lt;/title&gt;
    &lt;link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"&gt;
    &lt;link href="style.css" type="text/css" rel="stylesheet" /&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
    &lt;div id="wrapper"&gt;
      &lt;div id="bg"&gt;
        &lt;header&gt;
          &lt;div class="header"&gt;
            &lt;div&gt;
              &lt;i class="menu_hang"&gt;&lt;/i&gt;
            &lt;/div&gt;
            &lt;div class="logo"&gt;
              &lt;h2&gt;HIM&lt;/h2&gt;
            &lt;/div&gt;
            &lt;div&gt;
              &lt;a href=""&gt;share&lt;/a&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/header&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>here is my code
  <a href="https://plnkr.co/edit/Jlx5tzSB3CKQRVGrFSfh?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/Jlx5tzSB3CKQRVGrFSfh?p=preview</a></p>
  
  <p>After using <code>display flex</code> . i am facing two issue</p>
  
  <ol>
  <li><p>Menu is hide .</p></li>
  <li><p>share <code>anchor tag</code> is showing on top</p></li>
  </ol>