鍍金池/ 問答/UI  HTML/ flex 在 ie11 下面的兼容問題

flex 在 ie11 下面的兼容問題

element-ui-1.4 的 el-menu 組件出現(xiàn)了一個樣式兼容的問題

下面是我抽出來的最簡單的 html 和 css 還原這個現(xiàn)象

有什么好的方式去解決呢?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>flex</title>
    <style>
        .outer {
            width: 100px;
            position: relative;
        }
        .menu {
            display: flex;
            position: absolute;
            top: 54px;
            left: 0;
            padding: 20px;
            background-color: green
        }
        .col {
            height: 200px;
            background: red;
        }

        .inner {
            width: 100px;
        }

        .yellow {
            background-color: yellow;
        }

        .blue {
            background-color: blue;
        }

    </style>
</head>
<body>
    <div class="outer">
        <div class="menu">
            <div class="col yellow">
                <div class="inner"></div>
            </div>
            <div class="col blue">
                <div class="inner"></div>                
            </div>
        </div>
    </div>
</body>
</html>

ie 下的表現(xiàn)

clipboard.png

chrome 理想表現(xiàn)

clipboard.png

回答
編輯回答
朕略傻

clipboard.png
IE9是不支持flex的
你可以在IE9下直接使用position去實(shí)現(xiàn),把display:flex去掉

2018年2月2日 15:31