title: Positioning <img> element inside <span> element which both are in <li> element?
body: <p>I have 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>#left {
    float: left;
    width: 40%;
  }
  
  nav ul {
    list-style-type: none;
  }
  
  nav ul li {
    border-bottom: 2px solid red;
    border-left: 2px solid red;
    border-right: 2px solid red;
  }
  
  nav ul li a {
    text-decoration: none;
  }
  
  .menu {
    float: right;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="left"&gt;
    &lt;nav&gt;
      &lt;ul&gt;
        &lt;li&gt;
          &lt;a href="#"&gt;medical center&lt;/a&gt;
          &lt;span class="menu"&gt;
            &lt;img src="https://i.stack.imgur.com/Af2zp.png" width="25px"&gt;
          &lt;/span&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;a href="#"&gt;medical tips&lt;/a&gt;
          &lt;span class="menu"&gt;
            &lt;img src="https://i.stack.imgur.com/Af2zp.png" width="25px"&gt;
          &lt;/span&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;a href="#"&gt;medical center&lt;/a&gt;
          &lt;span class="menu"&gt;
            &lt;img src="https://i.stack.imgur.com/Af2zp.png" width="25px"&gt;
          &lt;/span&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;a href="#"&gt;medical smtg&lt;/a&gt;
          &lt;span class="menu"&gt;
            &lt;img src="https://i.stack.imgur.com/Af2zp.png" width="25px"&gt;
          &lt;/span&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;a href="#"&gt;medical smtg2&lt;/a&gt;
          &lt;span class="menu"&gt;
            &lt;img src="https://i.stack.imgur.com/Af2zp.png" width="25px"&gt;
          &lt;/span&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;a href="#"&gt;medical smtg3&lt;/a&gt;
          &lt;span class="menu"&gt;
            &lt;img src="https://i.stack.imgur.com/Af2zp.png" width="25px"&gt;
          &lt;/span&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Which looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/IyyZc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IyyZc.png" alt="enter image description here"></a></p>
  
  <p>I have to make it like this:</p>
  
  <p><a href="https://i.stack.imgur.com/q3IEn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q3IEn.png" alt="enter image description here"></a></p>
  
  <p>How can I achieve that?</p>