CSS3 fading out text

Issue

I’ve been trying to get my text to fade out. I’ve tried some codes I’ve found on the internet, but they seem to be only for block elements.

Solution

Never mind, I’ve found my own solution.

blablablabla<span class="readmore">blablablabla</span>

.readmore {
-webkit-mask-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 40%);
}

Unfortunately, only works on webkit.

Answered By – Duncan

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published