Languages
[Edit]
EN

CSS - change text opacity

3 points
Created by:
Saim-Mccullough
688

In this article, we would like to show you how to change text opacity using CSS.

Quick solution:

or:

 

Practical example

Edit

To set semi transparent text, we use rgba() colors where a is alpha value that sets the opacity. The alpha value can be number from 0 - 1 (or percentage value 0% - 100%).

 

Alternative solution 1

Edit

It is possible to achieve transparent text on whole element using opacity style property value, what was shown in the below example.

 

Alternative solution 2

Edit

In this section you can find solution that sets opacity on whole element. This approach has great legacy (it works in very old web browsers).

References

Edit
  1. rgba() - CSS: Cascading Style Sheets | MDN

Alternative titles

  1. CSS - set text partly transparent color
  2. CSS - change text transparency
  3. CSS - set text semi transparent color
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join