Dino Geek, try to help you

How to create a gradient text effect with CSS?


To create a gradient text effect with CSS, we can make use of the property `background-clip: text` in combination with a linear or radial gradient. Here’s a simple example:

HTML:
```

Hello World


```

CSS:
```
.gradient-text { font-size: 60px; background: linear-gradient(to right, red , blue); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
```

This code gives a gradient effect to the text that goes from red at the left to blue at the right. Please note that `-webkit-background-clip: text` and `-webkit-text-fill-color: transparent` are not standard CSS properties, they are specific to Webkit browsers like Chrome and Safari. For Firefox use the following CSS rule to achieve the same effect:

```
.gradient-text { font-size: 60px; background: linear-gradient(to right, red , blue); background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
```

If you want to improve cross-browser compatibility, you could fall back to solid color text in unsupported browsers. Unlike gradients, `background-clip: text` won’t fall back gracefully. See the below CSS code:

```
.gradient-text { font-size: 60px; background: linear-gradient(to right, red , blue); color: blue; /* fallback for non-webkit browsers */ -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
```

This will show a blue text color in browsers that do not support `background-clip: text`.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use