How does CSS achieve background transparency in web design? Example

Source: Internet
Author: User
In the web design, sometimes you need to implement the CSS background transparent text opaque effect. So how do you make the background transparent through CSS? This article will show you how to use CSS to set the background transparent and text opaque method. Hope to be helpful to the needy friend.

CSS background transparent text opaque specific code examples are as follows:

<! DOCTYPE html>

Effects such as:

From the obvious, CSS realizes the div background transparent, and the text opaque effect. The point of knowledge we need to master here is the Rgba () function in Background-color. Use Rgba (0,0,0,0.5) in CSS to represent Rgha. The last parameter represents the alpha channel, which represents transparency.

And by the way, there are three ways to define colors in CSS: Using color methods (RGB, RGBA, HSL, HSLA), hexadecimal color values, and predefined color names. RGBA is an abbreviation that represents red (red) green (green) blue (blue) and Alpha (opacity) three words.

Value:

R The red value. Positive integers | Percentage
G The green value. Positive integers | Percentage
B The blue value. Positive integers | Percentage
A Alpha transparency. Value between 0~1.

Then through the above about using CSS to set the background transparent, text opaque effect content introduced, I hope to have the need for friends to help.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.