I have been searching high and low, but I have not found a CSS3 method for using a linear-gradient to fade the bottom of a <section> tag to white.
If I’m not being clear, let me illustrate this with an example. If I have a <section> tag which is full of lots of text, I would like the text to be cut off at a designated height. To show that there is still more text to be read, the container would display a white gradient which partially covers the last line or so to show that there is more text to read.
I know that this can be done with PNGs or GIFs, but I don’t know how to do this with CSS3. Could someone provide an example?
Thank you for your time.
You can do it with an extra element and some JavaScript. Like this:
And the JavaScript:
Here’s a working demo.