css rgba透明
Introduction:
介绍:
Functions are used regularly while we are developing a web page or website. Therefore, to be a good developer you need to master as many functions as you can. This way your coding knowledge will increase as well and you will not have to bother to write long codes. Using functions optimizes your codes as that long coding is replaced by abstract functions. So, whenever you are free just go through some functions which you have not heard about and start learning them and implement them in your code. This article is not any different, this article also focuses on one such function that would prove to be very useful for you in your web development. So, without much adieu let us take this discussion forward.
我们在开发网页或网站时会定期使用功能。 因此,要成为一名优秀的开发人员,您需要掌握尽可能多的功能。 这样,您的编码知识也将增加,并且您不必费心编写长代码。 使用函数可以优化代码,因为长编码已被抽象函数取代。 因此,每当有空时,只需浏览一些您从未听说过的功能,然后开始学习它们并在代码中实现它们。 本文没有什么不同,本文还重点介绍了一种对您的Web开发非常有用的功能。 因此,让我们继续进行讨论。
Definition:
定义:
rgba() function is a very popular function, you will see this function in almost every web page or website. It seems like an important function too right? Indeed it is, let us understand this function with the help of its definition and syntax.
rgba()函数是一个非常流行的函数,几乎在每个网页或网站上都会看到此函数。 似乎重要功能太正确了吗? 的确如此,让我们借助其定义和语法来了解此功能。
rgba() function is a very easy-to-understand function and it is used almost regularly, so what does it actually do? Keep reading for the answer.
RGBA stands for Red, Blue, Green and Alpha. These four values together make up the rgba() function. You must be familiar with red, blue and green colors but what does alpha do? Well, alpha is used for transparency or opacity. If you set the value of alpha to 0, then your element would be transparent and if you set it to 1, then it would be nothing but opaque. Well, that is all for the rgba() function. So, let us move forward and have a look at the syntax of this function,
rgba()函数是一个非常易于理解的函数,几乎经常使用,所以它实际上是做什么的? 继续阅读答案。
RGBA代表红色,蓝色,绿色和Alpha 。 这四个值共同构成了rgba()函数 。 您必须熟悉红色,蓝色和绿色,但是alpha的作用是什么? 好吧,alpha用于透明度或不透明度。 如果将alpha的值设置为0,则元素将是透明的;如果将其设置为1,则元素将是不透明的。 好了,这就是rgba()函数的全部 。 因此,让我们继续前进,看看该函数的语法,
Syntax:
句法:
element{
color:rgba(red,blue,green,alpha);
}
Example:
例:
<!DOCTYPE html>
<html>
<head>
<style>
p {
background-color: rgba(24, 253, 0, 1);
font-size: 50px;
color: rgba(234, 0, 0, 1);
}
</style>
</head>
<body>
<p>My name is Anjali Singh.</p>
</body>
</html>
Output
输出量
In the above example, both the font and the background color are set through the rgba() function.
在上面的示例中,字体和背景色都是通过rgba()函数设置的 。
You would be amazed by this function when you put it to use. This function will present to you about thousands of colors and with different shades for you to use. By making use of these colors you can make your website or web page attractive and stylish. So, don't miss the chance to play around with this function and explore as many colors as you can.
当您使用此功能时,您会感到惊讶。 此功能将为您呈现大约数千种颜色和不同阴影以供您使用。 通过使用这些颜色,可以使您的网站或网页更具吸引力和时尚感。 因此,不要错过尝试使用此功能并探索尽可能多的颜色的机会。
Conclusion:
结论:
To make the right use of this function, first select a theme for your website or web page, whether you want your website or web page to be dark or bluish or reddish. Once you have decided that then you are all set to select colors for your elements that go with the overall theme of your web page or website.
要正确使用此功能,请先为您的网站或网页选择一个主题,无论您希望网站或网页是深色还是蓝色或红色。 一旦确定,就可以为网页或网站的整体主题选择元素的颜色。
翻译自: https://www.includehelp.com/code-snippets/rgba-function-with-example-in-css.aspx
css rgba透明