Tips for Making Stylish Text using Gradient and Emboss Effects in CSS

I'm on a quest to achieve a unique visual impact for text using CSS that combines both a gradient and embossing. Take a look at the image I've included to see the effect I'm striving for.

Check out this Example Photo: https://i.sstatic.net/KEtlmZGy.png

This is the background style I have in mind:

background: linear-gradient(135deg, #3e296a 0%, #6d37ac 33%, #6d37ac 72%, #10dbac 100%);

And here are some Figma effects I'm considering:

https://i.sstatic.net/zOVUaOQ5.png https://i.sstatic.net/AJJNyN68.png

Here's what I've come up with so far:

<!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>

Answer №1

To achieve this effect, use the CSS properties background-clip and text-shadow

h2 {
    display: inline-block;
    width: 100%;
    font-family: 'Garamond';
    font-size: 160px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 30px;
    text-transform: uppercase;
    background: linear-gradient(119deg, #B37951 7.35%, #F1CEA8 37.25%, #CB9064 72.02%, #875635 94.44%);
    /* background-clip: border-box; */
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 10px 10px rgba(0,0,0,0.5);
}
<h2>Decor</h2>

Incorporate your color codes from figma by inserting them into the background property of your CSS.

Answer №2

Check out this cool example utilizing background-clip, text-shadow, -webkit-text-stroke, and filter. You may find some inspiration here. (You could also use an image or SVG for a similar effect)

* { box-sizing:border-box; margin:0 }
h1 {
  font-family: 'adlam display';
  font-size: clamp(20px, 25vw, 15em);
  padding: 2rem ;
  text-align: center;
  width: max-content;
  margin: auto;
  background: linear-gradient(90deg, #482b79, #6C36AB, #22bbab);
  background-clip: text;
  color: transparent;
  text-shadow: 0.001em 0.05em .01em #0004;
  -webkit-text-stroke: 0.01em #00000015;
  filter: brightness(120%)
}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=ADLaM+Display" media="all">
<h1>Decor</h1>

Answer №3

When using background-image, it allows the color to be displayed, while -webkit-background-clip is used to clip the background and text together, enabling the text to blend seamlessly with the background color.

.gradient-text {
  font-size: 3rem;
  font-weight: bold;
  background-image: linear-gradient(45deg, red, yellow, green, blue);
  -webkit-background-clip: text;
  color: transparent;
}
<div class="gradient-text">Decor</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to pass multiple variables, such as "Value" and "Selected", to the next HTML page in Flask without only passing "Selected"

I am currently utilizing Flask to generate an HTML form (specifically a dropdown menu) with values retrieved from a list output by a Python function. The variable in the Python app.py code is called "two_dimensional_list". Here are some sample values: [[&a ...

When using HTML5 input type number with 16 or more digits, Chrome automatically replaces any extra digits with zeroes

Has anyone else encountered an issue with Chrome related to using the input type number when the number of digits exceeds 16? I've noticed that in my case, any numbers beyond the 16th digit are automatically replaced with a zero when the field loses f ...

Creating a website that consistently functions in "lg" mode using Bootstrap

My website is fully responsive and I use the classes hidden-* and visible-* extensively. Now, I want to give mobile users the option to view the desktop version of the site by clicking on a button labeled "Desktop Website". Here are some Bootstrap tips fo ...

How to Align a Div Next to a Vertical Navigation Bar in Bootstrap 4

I've been attempting to position a div to the right side of a vertical navigation in Bootstrap 4, but I'm struggling to achieve the desired layout: <div class="container mt-3"> <div class="nav navbar navbar-expand-lg navbar-dark bg-da ...

Adding HTML attributes to a VueJS table allows for more customization and control

Is it possible to incorporate HTML/Bootstrap elements into a cell in VueJS? <b-table striped show-empty :items="filtered"> <template slot="top-row" slot-scope="{ fields }"> <td v-for="field in fields& ...

When an option is selected, the CSS class associated with that option is removed

<select class="FunctieSelect"> <option class="yellow" value="-1">- kies -</option> <option class="yellow" value="1">KSZ functie</option> <option class="yellow" value="2">Bakker</option> <option class="yellow" va ...

Text with gradient overlays

After successfully implementing a gradient effect on an image, I am facing the issue of it covering my text as well. I am struggling to locate the part of the code that needs to be modified in order to prevent the text from being obscured by the gradient e ...

Tips for managing callbacks from a RESTful service API on IOS

Utilizing an API to enable users to register an account on my application. Currently, I have managed to craft the necessary URL in objective-C to submit the data, with the API documentation detailing the return codes that will indicate the outcome. My qu ...

What is the best way to clear the content of a contenteditable element in React?

I have a scenario where I am rendering an array of items, each with a contenteditable field. MainComponent.js import { useState } from "react"; import Item from "./Item"; import "./styles.css"; export default function MainC ...

How can I style the empty text in an ExtJS grid using CSS?

Is there a specific CSS class for a grid's emptyText? After inspecting the element with Firebug, all I found was: <div id="gridview-1021" class="x-component x-grid-view x-fit-item x-component-default x-unselectable" role="presentation" tabindex=" ...

What is the process of turning a picture from a menu file into a clickable link?

I have created a menu with some images included, and I want them to be clickable links. However, currently only the text on top of the images acts as a link when hovered over. I would like the entire image to be clickable, not just the text. I believe I ...

Having Trouble with Form Submission Button Across Different Web Browsers

Having some trouble with my form - all fields are properly closed with tags, but when I click the submit button, nothing happens. The page is loaded with code, so here's the link for you to check it out. Unfortunately, right-click is disabled, so ple ...

Attempting to transmit multiple variables

Can anyone provide assistance with passing multiple variables from one page to another? I am able to pass a single variable, but I need to send more than one by clicking a link. Below is a snippet of my code containing the rows I want to transmit to the ne ...

A single click causes the entire row of cards to extend seamlessly

The cards on this tab were generated using a loop and the data is sourced from a database. When I click on the "Show More" button, the entire visible column expands along with it. The expansion does not reveal the content immediately; instead, the content ...

Installing Fontawesome 4.3

I recently downloaded the Fontawesome pack, which includes css, Less, and other supporting files. I have successfully copied these files to my website. My website is running on the Gantry framework, which requires me to edit the Head Section in order to a ...

Reinitializing AngularJS form controls

Check out this codepen example: http://codepen.io/anon/pen/EjKqbW I'm trying to reset the form elements when the user clicks on "Reset". The div elements f1,f2,f3 should be hidden and the searchText box cleared. However, the reset button is not trig ...

Having some trouble with a z-index issue in IE6, I'm stumped on how to solve it

I'm currently working on an amazing header over at : Unfortunately, in IE6, the dropdown menus from the Print and View buttons are collapsing onto a new line. This issue is due to a common z-index bug. I attempted to solve it by setting the parent d ...

What steps should be taken to switch a class from one li element to another and remove it in the process?

As I develop the navigation bar for my website, I am faced with a challenge. I want to create a button-like behavior where clicking on an li element triggers a drop-down section underneath it without using the # attribute to prevent jumping to the top of t ...

What is the best way to generate a one-level breadcrumb using Jquery?

In certain applications, I am interested in implementing a single-level breadcrumb trail that looks like this: Home -> Product -> Applications -> Application 1 Since 'Applications' can have several children, I want to incorporate a dro ...

The view has no access to $scope but the controller does

I need to display the iso code using a $scope when selecting a country from a list. The list of countries is fetched through a $http call in a factory and then stored in a scope. ///////// get countries //////////////// tableFactory.getCountries().then(f ...