Transparent rounded rectangle for IE browser compatibility

Source: Internet
Author: User

Transparent rounded rectangle for IE browser compatibility

Although ie makes web developers abandon and is somewhat incompatible with the trend of the times, as long as someone is using IE, as web developers, we have to work hard to solve various problems. I personally feel that it is boring to adjust the browser every day. Instead, I feel that this is part of my life and should be a front-end capability.

As we all know, the rounded corner is a new property of css3. like the transparent opacity, they only support IE9. The IE filter supports 4 to 9. Filter is not recognized by IE10 or later. Therefore, the opacity attribute and filter attribute are set for a translucent blue rounded corner div. We will not solve the problem of corner failure in IE8 for the moment.

IE8 and earlier automatically blocks the opacity attribute and only recognizes the filter attribute,


Code for implementing translucent blue:

background: rgba(0, 0, 0, 0.12);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000,endColorstr=#19000000);

In this Code, rgba 0.12 represents the opacity transparency and will not be recognized.

For more information about the meaning of the filter code, see my other blog-usage of filter.


IE9 recognizes both opacity and filter attributes,

Principal/fP1Mq + s/Principal + Principal/fAtsmr0Ke5 + 7 HIvc + Principal/bP1sHLoaM8L3A + Principal + CjxwPjxwcmUgY2xhc3M9 "brush: java;" >:root # ie9-filter {filter: none ;}Give this div an id named ie9-filter. The filter is set to none, meaning that the filter is not applicable in IE9. The effect is as follows:

This effect is the same as that in IE10. IE10 and later browsers cannot identify the filter attribute, so we can use rgba with confidence.


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.