【发布时间】:2016-06-21 21:14:36
【问题描述】:
当我有一个带有居中项目的 flexbox 时,:hover 伪类在 Chrome 中无法正常工作。悬停只针对居中项目的顶部 3/4 进行注册,而不是底部四分之一。 gif showing the problem
#container {
margin-top: 50px;
width: 100%;
height: 50px;
background-color: rgba(67, 67, 67, 0.8);
display: flex;
align-items: center;
justify-content: flex;
}
#img-container {
height: 140px;
width: 140px;
border-radius: 140px;
background-color: blue;
}
#img-container:hover {
border: 5px solid red;
}
#under {
height: 50px;
width: 100%;
}
<div id="container">
<div id="img-container"></div>
</div>
<div id="under"></div>
【问题讨论】:
-
在 chrome 47 中显示良好
-
@Scott:奇怪,我在 OS X 上使用 Chrome 49。
标签: html css google-chrome hover flexbox