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 文本背景色透明