Member-only story
CSS Tips : Color text using image
Let’s look at a simple bit of css that will allow us to color regular text using a image. Sure, you can set a text color using css, but with this simple technique, the text will adopt the color of the image you use.
Here is the very simple css to make this effect.
.text {
background-image: url('background.jpg');
background-clip:text;
-webkit-background-clip:text;
color:transparent; font-size:150px;
}
Obviously you’ll want to set your own image filename as well as the font size and any other parameters you want. The first 4 lines of the css style is what makes the effect happen.