Fade out text on image
问题 I know how to fade out a text on a plain colored background with a CSS transparent gradient. But how is it possible to fade out a text on an image background? Here is an example of what I'd like: NB: I need a static effect just like the image (not a dynamic transition). 回答1: CSS mask-image is probably what you are looking for: div { background: #333; padding: 1em; } p { color: white; font-weight: bold; -webkit-mask-image: linear-gradient(to bottom, white, transparent); mask-image: linear