Sarfaraz Alam
Sarfaraz Alam

Reputation: 149

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

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

Upvotes: 12

Views: 41764

Answers (2)

Aida_Aida
Aida_Aida

Reputation: 551

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/

Upvotes: 22

SW4
SW4

Reputation: 71200

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

Upvotes: 5

Related Questions