这是一个例子
.FlexContainer {
background: hsla(0,0%,0%,.1);
display: flex;
flex-direction: column;
max-height: 220px;
margin: 10px;
padding: 20px;
width: 300px;
overflow-y: auto;
}
.FlexItem {
background: hsla(0,0%,0%,.1);
width: 80%;
margin: 2px;
padding: 6px;
word-break: break-all;
white-space: normal;
cursor: pointer;
}
.FlexItem:hover{
background-color: red;
}
<html>
<head>
<title>demo</title>
</head>
<body>
<div class="FlexContainer">
<div class="FlexItem">
The contents is short in IE11.
</div>
<div class="FlexItem">
The contents is long - inside of this box are overflowing their container in IE11.
</div>
<div class="FlexItem">
The contents inside of this box are overflowing their container in IE11.
</div>
<div class="FlexItem">
The contents inside of this box are overflowing their container in IE11.
</div>
<div class="FlexItem">
The contents inside of this box are overflowing their container in IE11.
</div>
<div class="FlexItem">
The contents inside of this box are overflowing their container in IE11.
</div>
<div class="FlexItem">
The contents inside of this box are overflowing their container in IE11.
</div>
<div class="FlexItem">
The contents inside of this box are overflowing their container in IE11.
</div>
<div class="FlexItem">
The contents inside of this box are overflowing their container in IE11.
</div>
<div class="FlexItem">
The contents inside of this box are overflowing their container in IE11.
</div>
</div>
</body>
</html>
在chrome中可以正常工作 chrome work well
但是在IE11中,这并不是我所期望的。 IE11 work not expected
仅当容器高度小于fex项目并设置溢出-y:auto / scroll时,才会发生此问题。
有人可以帮助我找到问题的原因吗?
感谢您的帮助。