Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invisible (transparent) font color with css on all major browsers

Tags:

css

Is it possible to make the font (font-color) transparent while using any color like black or white? Just have the font slowly disappear, like display:none. Thanks

like image 536
Sarfaraz Alam Avatar asked Nov 18 '13 12:11

Sarfaraz Alam


People also ask

How do I change the font color to transparent in CSS?

To set the opacity of a background, image, text, or other element, you can use the CSS opacity property. Values for this property range from 0 to 1. If you set the property to 0, the styled element will be completely transparent (ie. invisible).

Can a background color be transparent CSS?

The CSS color name transparent creates a completely transparent color. Using rgba or hsla color functions, that allow you to add the alpha channel (opacity) to the rgb and hsl functions. Their alpha values range from 0 - 1.

How do you make text color transparent?

There is no color code for making text transparent in HTML or CSS. However, you can make text appear to be transparent on a web page by setting the text color to the same color as the background color.

What is the Colour code for transparent?

#0000ffff - that is the code that you need for transparent.


2 Answers

You can use css property

opacity: 0; 

and you will not be able to select the text,

or

color: transparent;

and you will have the chance to select the text.

If you want to make this slowly look at jQuery functions .fadeOut() http://api.jquery.com/fadeOut/ or .animate() http://api.jquery.com/animate/

like image 101
Aida_Aida Avatar answered Sep 21 '22 17:09

Aida_Aida


You can use RGBA colors, where the last level is alpha (transparency), e.g.:

color:rgba(255,0,0,0.3);

Which is red at 30% opacity. RGBA values are supported by IE9+, Firefox 3+, Chrome, Safari, and in Opera 10+.

You also have HSLA, e.g.:

color: hsla(0,100%,50%,0.6);

Again, the last value, alpha, sets the transparency

like image 28
SW4 Avatar answered Sep 18 '22 17:09

SW4