I am seeking to create a visual effect for text using CSS that incorporates both a gradient and embossing. I’ve attached an image to show the effect I’m aiming for.
Here’s the background style I’m working with:
background: linear-gradient(135deg, #3e296a 0%, #6d37ac 33%, #6d37ac 72%, #10dbac 100%);
And Figma effects:
I’ve done this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gradient Text with Emboss Effect</title>
<style>
.gradient-text {
font-size: 100px;
font-weight: bold;
background: linear-gradient(135deg, #3e296a, #6d37ac, #10dbac);
-webkit-background-clip: text;
color: transparent;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25), 0px 4px 0px rgba(255, 255, 255, 0.3);
}
</style>
</head>
<body>
<div class="gradient-text">Decor</div>
</body>
</html>
2
Answers
try this Background-image applies the color and the.
-webkit-background-clip
clips the background and text together the text is transparent to merge with background colorCan be done using
background-clip
andtext-shadow
You can paste your color codes from figma in the
background
property of the CSS.