Is there transparent color or how do I make text transparent?

Updated: 01/24/2018 by Computer Hope
Transparent font

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.

For example, if the background color of the body or a specific element on the page is white (#FFFFFF), the text can appear to be transparent by setting its color to white. See the code example below for how to make text transparent.

<body style="background-color:#FFFFFF">
<div style="color:#FFFFFF">
This text would not be seen by the viewer in the browser window.
</div>
</body>

Below is an example of text that appears transparent, but really is the same color as the background color. You can see this text by using your mouse to highlight the hidden text in the below box.

This text would not be seen by the viewer in the browser window.

Note

This technique only makes the text appear transparent in the browser window using your style sheet. If the viewers do not have style sheets on or set their own custom style sheets to override others, then the text may still display. Also, the text can be viewed at any time by viewing the page's source code.

Warning

If you want to hide text from humans, but want to allow search engines like Google to find keywords on your page, it is against Google's TOS. This action may cause Google and other search engines to stop indexing your website's pages. There are better ways to promote your web page than using this type of tactic.

Additional information