I am trying to create a text fade-out effect when the amount of text is bigger than the row can handle. I am achieving this with the mixture of max-height
, overflow
and linear-gradient
. Something like this.
max-height:200px;
overflow:hidden;
text-overflow: ellipsis;
background: -webkit-linear-gradient(#000, #fff);
The full fiddle is available. I am trying to achieve effect similar to this one
and I am kind of close. The problem is that in my case text start to fade-out from the very beginning and I want it to start fading out only if it is really close to maximum size. Lets say start fading out if it is already 150px. Also I am using only -webkit
prefix and I assume that there may be other prefixes that I can add for other rendering engines.
Is there a way to do this in pure CSS?
-webkit-background-clip:text
which is supported only by webkit-based browsers (I think): jsfiddle.net/b9vtW/1