title: Android WebView - background-size:cover not working for small images (Image doesen't scale)
body: <p>I am trying to create the simple parallax effect using the inline css by putting it in Android WebView like below,</p>
  
  <pre><code>String FEATURED_IMAGE = "&lt;div style=\"background:url(" + mPostList.get(position).IMG_URL + ") no-repeat center top fixed;" +
              " min-height:200px;" +
              " -webkit-background-size:cover;" +
              " -moz-background-size:cover;" +
              " background-size:cover;" +
              " -webkit-box-shadow: inset 0 0 1000px #000000; \"&gt;"
              + "&lt;/div&gt;";
  </code></pre>
  
  <p>Screens:</p>
  
  <p>With Big Image: </p>
  
  <p><img src="https://i.stack.imgur.com/8ybB8.png" alt="Big Image shown without any problem"></p>
  
  <p>With Small Image: </p>
  
  <p><img src="https://i.stack.imgur.com/mlBfs.png" alt="enter image description here"></p>
  
  <p>When I run above code on codePen it worked without any problems but its not working in Android WebView.</p>
  
  <p>Below is Logged FEATURED_IMAGE string,</p>
  
  <pre><code>I/FEATURED_IMAGE﹕ &lt;div style="background:url(http://2.bp.blogspot.com/_fWuGPZ0ArA4/S6818iPuBCI/AAAAAAAAAlo/HSQOBcdU7nk/s200/120px-Crocus_imperatii_subsp__suaveolens1a_UME.jpg) no-repeat center top fixed; min-height:200px; -webkit-background-size:cover; -moz-background-size:cover; background-size:cover; -webkit-box-shadow: inset 0 0 1000px #000000; "&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I have also tried, </p>
  
  <pre><code>background-size:100% 100%; and
  background-size:contain;
  </code></pre>
  
  <p>EDIT:(The full code gets loaded in WebView is below..)</p>
  
  <pre><code>&lt;body style="margin:0; padding:0"&gt;
  &lt;div style="background-image:url(http://2.bp.blogspot.com/_fWuGPZ0ArA4/S6818iPuBCI/AAAAAAAAAlo/HSQOBcdU7nk/s200/120px-Crocus_imperatii_subsp__suaveolens1a_UME.jpg); background-repeat:no-repeat; background-position:center top; background-attachment:fixed; min-height:200px; -webkit-background-size:cover; -webkit-box-shadow: inset 0 0 1000px #000000; "&gt;&lt;/div&gt;
  &lt;div style = "background:#F44336; padding:10px 0 10px 10px;"&gt;
      &lt;h3 style="color:#ffffff"&gt;Grow Crocus Flowers - Welcome to Spring.&lt;/h3&gt;
      &lt;p style="color:#ffffff"&gt;2 Comments / 2010-03-28&lt;/p&gt;
      &lt;p style="color:#ffffff"&gt;Posted By - 
          &lt;a style="color:#ffffff" href="http://www.blogger.com/profile/04668325431299702401"&gt;terry blackburn&lt;/a&gt;
      &lt;/p&gt;
  &lt;/div&gt;
  &lt;div style="padding:10px"&gt;
      &lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
          &lt;a href="http://2.bp.blogspot.com/_fWuGPZ0ArA4/S6818iPuBCI/AAAAAAAAAlo/HSQOBcdU7nk/s1600/120px-Crocus_imperatii_subsp__suaveolens1a_UME.jpg"&gt;
              &lt;img style="margin-top:10px; margin-bottom:10px; width: 100%;" alt="" border="0" src="http://2.bp.blogspot.com/_fWuGPZ0ArA4/S6818iPuBCI/AAAAAAAAAlo/HSQOBcdU7nk/s200/120px-Crocus_imperatii_subsp__suaveolens1a_UME.jpg" id="BLOGGER_PHOTO_ID_5453636987870118946" style="cursor: hand;   margin: 0px 10px 10px 0px; width:100%" /&gt;
          &lt;/a&gt;
          &lt;br /&gt;
  I was strolling through our local park today basking in the Sunshine. The clocks went forward at midnight last night and there was a real feel of Spring in the air. A cold gusting wind was blowing, but nevertheless, the sight of the Sun in a blue, almost cloudless sky, raised my spirits enormously. It has been a long, dark, cold winter, (whatever happened to global warming!) and we in the North of England desperately need some warm weather to cheer us up.
          &lt;br /&gt;
  Trudging along, my eye was attracted to a splash of colour dotted about on the grass and on further inspection, this turned out to be a carpet of Crocuses, in a profusion of yellow, purple and white colours. God must have been having a good day when he created the Crocus. There is nothing more guaranteed to raise the spirits than the sight of a profusion of Crocuses spreadeagled across the grass. I just love the seemingly undisciplined way they grow - no straight lines, just a myriad of colours waving at me in the wind. It is as though someone has taken a paintbox of colours and sprinkled them haphazardly in a carpet across the grass.
          &lt;br /&gt;
  The Crocus, or Saffron is one of the Lily family, and is a hardy perennial plant which is believed to have originated in the Mediterranean area where it was first harvested, so legend has it, on the Island of Crete! As one of the first flowers to bloom in spring, crocuses are of course immensely popular. The plants grow from corms and their cup-shaped, solitary, "salverform" flowers taper off into a narrow tube. Their flowers and leaves are protected from Winter snow and frosty conditions by a waxy cuticle and it is a wonderful sight to see them pushing their way up through a sprinkling of snow. 
          &lt;br /&gt;
  Cultivation of the plant is no trouble at all, as they can be left very much to themselves to develop, although they do need regular cutting back as they seed abundantly. They thrive in light, sandy, gritty, well drained loam, flowering usually at the beginning of March in the UK. They should be planted in a sunny position, although some species do prefer shadier sites. The corms should be planted about an inch and a half to two inches deep.
          &lt;br /&gt;
  So if you want to create a brilliant and uplifting display in your garden for next early Spring, take my advice and plant Crocus flowers, you won't be sorry!
          &lt;br /&gt;
          &lt;br /&gt;
  I hope you like this rather whimsical article. If you do, then why not share your thoughts with me... always interested to receive your thoughts, especially if they are positive ones.
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>What's wrong I am doing?</p>