title: CSS- float right not working
body: <p>I'm trying to write a navigation bar for a website in HTML and CSS. I have an image of the twitter icon that I would like on the right side. I have tried using float:right on the image and its containing  tag. Can anyone tell me how I could do this? Here is my code:</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 {
    margin: 0;
    padding: 0;
    font-family: "Arial";
  }
  
  header {
    height: 60px;
    width: 100%;
  }
  
  .nav {
    display: flex;
    height: 60px;
    width: 100%;
    vertical-align: middle;
    box-shadow: 0 0 0 2px #C3C3C3;
    position: absolute;
  }
  
  img.logo {
    height: 50px;
    width: 50px;
    margin: 0 20px;
  }
  
  ul {
      display: flex;
      list-style-type: none;
      margin: 0;
      padding: 0;
      overflow: hidden;
      background-color: #FFF;
  }
  
  li a {
      display: block;
      color: white;
      text-align: center;
      padding: 21px 16px;
      margin: 0 10px;
      text-decoration: none;
      color: #7D848E
  }
  
  li a:hover {
      background-color: #111;
  }
  
  img.twitter {
    height: 40px;
    width: 40px;
    margin: 10px 10px;
  }
  
  a.twitter {
    display: block;
    float: right;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  &lt;body&gt;
  
      &lt;div class="nav"&gt;
        &lt;a href="#"&gt;
          &lt;img class="logo" src="/static/arch.png"&gt;
        &lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href="#"&gt;ITEM&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;ITEM&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;ITEM&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;ITEM&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
        &lt;a class="twitter" href="http://www.twitter.com"&gt;
          &lt;img class="twitter" src="/static/twitter.png"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
  
    &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>