1. 程式人生 > >border-radius IE8相容處理

border-radius IE8相容處理

<!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瀏覽器效果: 在這裡插入圖片描述 border-radius在IE8瀏覽器相容方案:

<!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;
                /*關鍵屬性設定 需要把路徑設定好*/
                behavior: url(PIE.htc);
            }
        </style>
    </head>

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

</html>

在這裡插入圖片描述

感謝分享https://www.cnblogs.com/mengfangui/p/6605761.html