flex的IE兼容性
在 IE11 上 align-items 對于父元素設(shè)置 min-hight 高度不能實(shí)現(xiàn)垂直居中。設(shè)置為 height: 20px 就可以了。
示例:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.ct{
display: flex;
align-items: center;
justify-content: center;
min-height: 3em;
background: #f00;
}
.item{
background: #ccc;
}
</style>
<title>flex的IE兼容性問題</title>
</head>
<body>
<div class="ct">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
</div>
</body>
</html>