How to set the transparency of a div but the text is opaque

Source: Internet
Author: User

How to set the transparency of a div but the text is opaque:

When setting div transparency there may be many friends who encounter the problem that the text in the object is also transparent, can not be said to be flawed, and may sometimes require such an effect. Here is how to set the object to be transparent, but the text is not clear. The code example is as follows:

<! doctype html> 

The

Above code sets the second div to translucent, but the text also appears transparent. So change the code here:

<! doctype html> 

The above code implements the desired effect. The way to do this is to say that the span element is removed from the Div, using absolute positioning, and then positioning the span element where it was originally located in the DIV element.

The original address is: http://www.51texiao.cn/div_cssjiaocheng/2015/0501/514.html

How to set the transparency of a div but the text is opaque

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.