Pure CSS Text Gradients


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /* CSS text gradients */
  2. h2[data-text] {
  3. position: relative;
  4. }
  5. h2[data-text]::after {
  6. content: attr(data-text);
  7. z-index: 10;
  8. color: #e3e3e3;
  9. position: absolute;
  10. top: 0;
  11. left: 0;
  12. -webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,0)), color-stop(50%, rgba(0,0,0,1)), to(rgba(0,0,0,0)));

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.