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透明