Compatible with css3 rounded corner codes of all browsers

Source: Internet
Author: User

But the headache is that many attributes of CSS3 are not supported by all browsers. I have always liked using a rounded rectangle as a container. After searching and exploring, I finally found a way to make the rounded corner compatible with all browsers.

This method is implemented using CSS + JS.

Introduce CurvyCorners (a JS rounded corner library, which uses all the native attributes of CSS3) on the page to be rounded, and use the addEvent function:

 

The code is as follows: Copy code
<Script type = "text/javascript" src = "curvycorners. js"> </script>
<Script type = "text/JavaScript">
AddEvent (window, 'load', initCorners );
Function initCorners (){
Var setting = {
Tl: {radius: 6 },
Tr: {radius: 6 },
Bl: {radius: 6 },
Br: {radius: 6 },
AntiAlias: true
        }
CurvyCorners (setting, ". threesnow ");
        }
</Script>

Tl, tr, bl, and br represent top-left, top-right, bottom-left, and bottom-right ).

Then write the style:

The code is as follows: Copy code

<Style>
. Threesnow
    {
Width: 220px;
Height: 120px;
Padding: 10px;
Background-color: # DDEEF6;
Border: 1px solid # DDEEF6;
        
-Webkit-border-radius: 6px;
-Moz-border-radius: 6px;
    }   
</Style>

By the way, you have to add HTML tags. Otherwise, what will be displayed.

The code is as follows: Copy code

<Div class = "threesnow">
</Div>

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.