title: UL and floating DIV: list text wraps but background color doesn't
body: <p>Need help with a floating <code>DIV</code> and a list. A <code>DIV</code> is floating to the right side of a page while list entries flow around it. The problem is that on applying background color to LI elements of the list the color stretches full width while text wraps on reaching DIV. How to make background color of LI's wrap like text does while keeping LI's display as blocks?</p>
  
  <p>Here is the example 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-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;style&gt;
    .mydiv {
      height: 200px;
      width: 200px;
      background-color: red;
      margin-right: 45px;
      float: right;
      clear: right;
    }
    
    li {
      background-color: cyan;
    }
  &lt;/style&gt;
  
  &lt;body&gt;
  
    &lt;div class="mydiv"&gt;&lt;/div&gt;
  
    &lt;ul&gt;
      &lt;li&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
        dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>