title: How can I set a linear gradient over text?
body: <p>So this is what I want to achieve:</p>
  
  <p><strong><em>(Ignore the turquoise cells)</em></strong></p>
  
  <p><a href="https://i.stack.imgur.com/xe7ce.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xe7ce.png" alt="enter image description here"></a></p>
  
  <p>As you may see, the whole text is blurry because of the gradiente which should be over the text. When you click on the READ MORE button, the element should go until the bottom and remove the gradient, and when you click on READ LESS, it should get back to its original state.</p>
  
  <p>Right now the design doesn't look like the one I did in the code and I need it exactly. But I am running out of ideas in order to get the same exact same thing as in the design.</p>
  
  <p>Any suggestions? </p>
  
  <p>And this is the 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-js lang-js prettyprint-override"><code>$(document).ready(function(){
      var toggleReadMore = function() {
        $('#read-more').click(function(e) {
            $(this).prev().animate({'height': $(this).prev()[0].scrollHeight + 'px'}, 400);
            $(this).hide();
            $(this).next('#read-less').show();
        });
        $('#read-less').click(function(e) {
            $(this).prev().prev().animate({height: '90px'}, 400);
            $(this).hide();
            $(this).prev('#read-more').show();
        });
  
      };
      toggleReadMore();
  }());</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#p {
    height: 50px;
    overflow: hidden;
  }
  #read-less {
   display: none;
  }
  #read-more,
  #read-less {
    background: linear-gradient(to bottom, rgba(255,0,0,0), rgba(255,255,255,1));
    color: blue;
    cursor: pointer;
    position: absolute;
    bottom: -20px;
    padding: 15px 0;
    text-align: center;
    width: 100%;
  }
  
  #wrapper {
    position: relative;
    width: 400px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id='wrapper'&gt;
    &lt;p id='p'&gt;Pinterest taxidermy et heirloom, ennui enim eu bicycle rights fugiat nesciunt commodo. High Life food truck jean shorts in. Blog asymmetrical cold-pressed photo booth. Neutra chia in, mustache Etsy nostrud plaid kogi. Magna polaroid stumptown aliqua put a bird on it gentrify, street art craft beer bicycle rights skateboard. DIY plaid gentrify, sustainable sapiente seitan mumblecore viral cardigan. Nisi pariatur laborum cornhole kitsch tempor fingerstache Bushwick. &lt;/p&gt;
    &lt;div id='read-more'&gt;
      READ MORE
    &lt;/div&gt;
     &lt;div id='read-less'&gt;
      READ LESS
    &lt;/div&gt; 
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>