Method of border radius IE8 compatible processing

Time:2020-7-28

According to canisue( http://caniuse.com/#search =The compatibility of border radius is shown in the following figure:

Test code:


<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <style type="text/css">
            * {
                margin: 0;
                padding: 0;
            }
            
            #header {
                width: 400px;
                height: 400px;
                margin: 10px;
                border-radius: 10px;
                border: 1px solid red;
            }
        </style>
    </head>

    <body>
        <div id="header">
        </div>
    </body>

</html>

IE8 browser effect:

Compatibility scheme of border radius in IE8 browser:

<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <style type="text/css">
            * {
                margin: 0;
                padding: 0;
            }
            
            #header {
                width: 400px;
                height: 400px;
                margin: 10px;
                border-radius: 10px;
                border: 1px solid red;
                /*Key attribute settings need to set the path well*/
                behavior: url(PIE.htc);
            }
        </style>
    </head>

    <body>
        <div id="header">
        </div>
    </body>

</html>

IE8 browser effect:

PIE.HTC Download address: http://css3pie.com/

Pie can handle some properties of CSS3, such as:

IE8: compatibility mainly includes:

(1) The CSS3 attribute is not supported. Use PIE.js Implement CSS3 effect.

(2)media query

The above is the whole content of this article, I hope to help you in your study, and I hope you can support developeppaer more.