element-ui-1.4 的 el-menu 组件出现了一个样式兼容的问题
下面是我抽出来的最简单的 html 和 css 还原这个现象
有什么好的方式去解决呢?
<!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 下的表现
chrome 理想表现
IE9是不支持flex的
你可以在IE9下直接使用position去实现,把display:flex去掉