css 文本背景色透明
Introduction:
介紹:
In web development, there are numerous ways by which we can style our websites or web pages. You can make use of lots of properties for creating attractive and responsive websites.
在Web開發中,我們可以通過多種方式來設計網站或網頁的樣式。 您可以利用許多屬性來創建吸引人的響應式網站。
Styling is very important for any website or web page. If your web page or website is not styled properly then there are chances that the audience would not like to go through your website or web page and if you have created a website or web page with good styling, then there are chances that your website or web page will draw a lot of attention.
樣式對于任何網站或網頁都非常重要。 如果您的網頁或網站的樣式設置不正確,則有可能觀眾不希望瀏覽您的網站或網頁,并且如果您創建的網站或網頁的樣式良好,則很有可能您的網站或網站網頁將引起很多關注。
Trivia:
瑣事:
Styling goes hand in hand while developing a web page or a website. You should dedicate as much time as you can while styling your website or web page. If you are just a beginner then you might face some problems when it comes to styling as initially, no one is aware of so many properties. So to be a good professional developer, you will need to learn as many properties as possible. When you have an abundance of knowledge about various properties then you will be able to style websites or web pages very swiftly and easily.
在開發網頁或網站時,樣式是齊頭并進的。 在設計網站或網頁的樣式時,您應該花費盡可能多的時間。 如果您只是一個初學者,那么像最初一樣在樣式方面可能會遇到一些問題,沒有人知道這么多的屬性。 因此,要成為一名優秀的專業開發人員,您將需要學習盡可能多的屬性。 如果您對各種屬性有足夠的了解,那么您將能夠非常輕松快捷地對網站或網頁進行樣式設置。
Here, in this article, we are going to discuss one aspect of styling the websites or web pages. From this article, you will learn how you can make the background of an image or a text as transparent.
在本文中,我們將在這里討論網站或網頁樣式的一方面。 從本文中,您將學習如何使圖像或文本的背景透明。
So, let us move on with the next section.
因此,讓我們繼續下一節。
Briefing:
簡報:
For setting the background of an image or a text as transparent you will have to make use of a certain property. This property is known as opacity. To achieve what you desire your opacity is the most crucial property at play. Before, we learn how we can set the background as transparent using this property. First, let us get familiar with the opacity property.
要將圖像或文本的背景設置為透明,必須使用某些屬性。 此屬性稱為不透明度 。 要實現您所希望的不透明度,是最關鍵的屬性。 在此之前,我們學習了如何使用此屬性將背景設置為透明。 首先,讓我們熟悉opacity屬性。
Property:
屬性:
The opacity is a property that would help in making any element as transparent or opaque or slightly translucent. You can make us of opacity property on any element. The scale of opacity property ranges from 0 to 1, where 0 is defined as completely transparent and 1 is defined as completely opaque.
不透明度是一種有助于使任何元素透明或不透明或稍微半透明的屬性。 您可以使我們在任何元素上都具有不透明度屬性。 不透明度屬性的范圍為0到1 ,其中0定義為完全透明,而1定義為完全不透明。
Now that we are familiar with the opacity property, let us discuss the solution now.
現在我們熟悉了opacity屬性,讓我們現在討論解決方案。
Syntax:
句法:
element{
opacity : value;
}
Example:
例:
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: #f40;
font-size: 40px;
text-align: center;
opacity: 0.5;
color: #fff;
}
</style>
</head>
<body>
<div>This is IncludeHelp</div>
</body>
</html>
Output
輸出量
In the above example, the opacity is set to 0.5.
在上面的示例中, 不透明度設置為0.5 。
翻譯自: https://www.includehelp.com/code-snippets/how-to-set-the-background-of-a-text-or-an-image-as-transparent-using-css.aspx
css 文本背景色透明