html set font color:[Today's HTML knowledge-2: Set the color to be transparent]-Font Tutorial免费ppt模版下载-道格办公

[Today's HTML knowledge-2: Set the color to be transparent]

#Headline Creation Challenge#

【Today's HTML Tips-2:Set the color to be transparent ] In the layout of the webpage, sometimes for the overall beauty of the webpage, it may be necessary to set some parts of the webpage to The background color is transparent, so how to set the background color to be transparent? This article will introduce to you how to set the background color to be transparentTwo ways.


1. Set the background color to be transparent through background and opacity

background property< /span>The property values ​​in the are relatively simple, so I won’t go into details here,opacity attribute parameter's "opacity" is expressed in numbers, from 0.0 to 1.0, completely transparent is 0.0, completely opaque is 1.0, in other words, higher numbers represent more opaque elements. The code example is as follows:

Note: Set background color transparency through backgroud and opacity, If there is text on the background, the text will also become transparent, just like the above effect.

2. Set the background color to be transparent through rgba

so calledRGBA color, that is RGB three primary colors plus ALPHA. Provides a transparency feature while adding color to the background.

Usage: background:rgba(R, G, B, A);

The code example is as follows:

Note: Set the transparency of the background color by rgba, you can Sets the background color to be transparent and the text to be opaque.



The above two methods of setting background transparent color for HTML , I hope it can help you who are learning HTML~~~

New author, if there are any deficiencies, I hope you can communicate more and add at any time~~~

Articles are uploaded by users and are for non-commercial browsing only. Posted by: Lomu, please indicate the source: https://www.daogebangong.com/en/articles/detail/Todays%20HTML%20knowledge2%20Set%20the%20color%20to%20be%20transparent.html

Like (810)
Reward 支付宝扫一扫 支付宝扫一扫
single-end

Related Suggestion