Html 当鼠标移到上方时,滑动覆盖div闪烁

Html 当鼠标移到上方时,滑动覆盖div闪烁,html,css,Html,Css,在构建引导Wordpress主题时,我遇到了以下问题: 我有一个div,悬停时显示一个覆盖层(从顶部滑入),当它滑入,我悬停元素时,它会闪烁。。。我不明白为什么 下面是一个代码示例: HTML CSS .reference容器{ 位置:相对位置; 溢出:隐藏; } .存档缩略图容器{ 位置:相对位置; } .参考摘录{ 位置:绝对位置; 底部:3em; 颜色:#fff; 宽度:100%; 背景:rgba(0,83184,0.8); 背景:莫兹线性梯度(左,rgba(0,83184,0.8)0

在构建引导Wordpress主题时,我遇到了以下问题:

我有一个div,悬停时显示一个覆盖层(从顶部滑入),当它滑入,我悬停元素时,它会闪烁。。。我不明白为什么

下面是一个代码示例:

HTML

CSS

.reference容器{
位置:相对位置;
溢出:隐藏;
}
.存档缩略图容器{
位置:相对位置;
}
.参考摘录{
位置:绝对位置;
底部:3em;
颜色:#fff;
宽度:100%;
背景:rgba(0,83184,0.8);
背景:莫兹线性梯度(左,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
背景:-webkit渐变(左上、右上、颜色停止(0%,rgba(0,83184,0.8))、颜色停止(57%,rgba(0,83184,0.7))、颜色停止(58%,rgba(0,83184,0.7))、颜色停止(80%,rgba(0,83184,0.42))、颜色停止(100%,rgba(0,83184,0));
背景:webkit线性梯度(左,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
背景:-o-线性梯度(左,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
背景:-ms线性梯度(左,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
背景:线性梯度(向右,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
过滤器:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0053b8',endColorstr='#0053b8',GradientType=1);
}
.参考摘录p{
字体大小:1.2米;
填充:0.2米;
页边距底部:0;
}
.参考标题{
位置:绝对位置;
顶部:0.5em;
左:1米;
颜色:#0052b8;
字号:2em;
字体大小:粗体;
文本阴影:2px2p4px#fff;
最大宽度:90%;
}
.参考内容{
最大宽度:100%;
}
.content hover{
位置:相对位置;
溢出:隐藏;
}
.内容悬停img{
-webkit转换:所有.5s线性;
-moz过渡:全部.5s线性;
过渡:全部.5s线性;
}
.内容悬停:悬停>img{
变换:比例(1.5,1.5);
过滤器:url(“数据:图像/svg+xml;utf8,#灰度”);/*Firefox 10+,Android上的Firefox*/
过滤器:灰色;/*IE6-9*/
-webkit过滤器:灰度(100%);/*Chrome 19+、Safari 6+、Safari 6+iOS*/
-webkit转换:所有.5s线性;
-moz过渡:全部.5s线性;
过渡:全部.5s线性;
}
.内容幻灯片:悬停+.内容悬停图片{
变换:比例(1.5,1.5);
过滤器:url(“数据:图像/svg+xml;utf8,#灰度”);/*Firefox 10+,Android上的Firefox*/
过滤器:灰色;/*IE6-9*/
-webkit过滤器:灰度(100%);/*Chrome 19+、Safari 6+、Safari 6+iOS*/
}
.内容幻灯片:悬停,.内容悬停:悬停+.内容幻灯片{
排名:0;
-webkit转换:所有.5s线性;
-moz过渡:全部.5s线性;
过渡:全部.5s线性;
}
.content幻灯片:悬停,.content悬停:悬停>。参考标题{
显示:无;
}
.内容幻灯片{
位置:绝对位置;
顶部:-360px;
-webkit过渡:前1名;
-moz转换:前1;
过渡:前1名;
}

正如乔·科尔比和我自己的评论所提到的; 正确的CSS是:

.reference-container {
    position: relative;
    overflow: hidden;
}
.archive-thumbnail-container {
    position: relative;
}
.reference-excerpt {
    position: absolute;
    bottom: 3em;
    color: #fff;
    width: 100%;
    background: rgba(0,83,184,0.8);
    background: -moz-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: -webkit-gradient(left top, right top, color-stop(0%, rgba(0,83,184,0.8)), color-stop(57%, rgba(0,83,184,0.7)), color-stop(58%, rgba(0,83,184,0.7)), color-stop(80%, rgba(0,83,184,0.42)), color-stop(100%, rgba(0,83,184,0)));
    background: -webkit-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: -o-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: -ms-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: linear-gradient(to right, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0053b8', endColorstr='#0053b8', GradientType=1 );
}
.reference-excerpt p {
    font-size: 1.2em;
    padding: 0.2em;
    margin-bottom: 0;
}
.reference-title {
    position: absolute;
    top: 0.5em;
    left: 1em;
    color: #0052b8;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px #fff;
    max-width: 90%;
}
.reference-content {
    max-width: 100%;
}
.content-hover { 
    position: relative;
    overflow: hidden;
}
.content-hover img {
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    transition: all .5s linear;
}
.content-hover:hover > img {
    transform: scale(1.5,1.5);
    filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
    filter: gray; /* IE6-9 */
    -webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    transition: all .5s linear;
}
.content-slide:hover + .content-hover img {
    transform: scale(1.5,1.5);
    filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
    filter: gray; /* IE6-9 */
    -webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}
.reference-container:hover > .content-slide {
    top: 0;
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    transition: all .5s linear;
}
.content-slide:hover, .content-hover:hover > .reference-title {
    display: -200px;
}
.content-slide {
    position: absolute;
    top: -360px;
    -webkit-transition: top 1s;
    -moz-transition: top 1s;
    transition: top 1s;
}
.reference容器{
位置:相对位置;
溢出:隐藏;
}
.存档缩略图容器{
位置:相对位置;
}
.参考摘录{
位置:绝对位置;
底部:3em;
颜色:#fff;
宽度:100%;
背景:rgba(0,83184,0.8);
背景:莫兹线性梯度(左,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
背景:-webkit渐变(左上、右上、颜色停止(0%,rgba(0,83184,0.8))、颜色停止(57%,rgba(0,83184,0.7))、颜色停止(58%,rgba(0,83184,0.7))、颜色停止(80%,rgba(0,83184,0.42))、颜色停止(100%,rgba(0,83184,0));
背景:webkit线性梯度(左,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
背景:-o-线性梯度(左,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
背景:-ms线性梯度(左,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
背景:线性梯度(向右,rgba(0,83184,0.8)0%,rgba(0,83184,0.7)57%,rgba(0,83184,0.7)58%,rgba(0,83184,0.42)80%,rgba(0,83184,0)100%);
过滤器:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0053b8',endColorstr='#0053b8',GradientType=1);
}
.参考摘录p{
字体大小:1.2米;
填充:0.2米;
页边距底部:0;
}
.参考标题{
位置:绝对位置;
顶部:0.5em;
左:1米;
颜色:#0052b8;
字号:2em;
字体大小:粗体;
文本阴影:2px2p4px#fff;
最大宽度:90%;
}
.参考内容{
最大宽度:100%;
}
.content hover{
位置:相对位置;
溢出:隐藏;
}
.内容悬停img{
-webkit转换:所有.5s线性;
-moz过渡:全部.5s线性;
过渡:全部.5s线性;
}
.内容悬停:悬停>img{
变换:比例(1.5,1.5);
过滤器:url(“数据:图像/svg+xml;utf8,#灰度”);/*Firefox 10+,Android上的Firefox*/
过滤器:灰色;/*IE6-9*/
-webkit过滤器:灰度(100%);/*Chrome 19+、Safari 6+、Safari 6+iOS*/
-webkit转换:所有.5s线性;
-moz过渡:全部.5s线性;
过渡:全部.5s线性;
}
.内容幻灯片:悬停+.内容悬停图片{
变换:比例(1.5,1.5);
过滤器:url(“数据:图像/svg+xml;utf8,#灰度”);/*Firefox 10+,Firefox o
.reference-container {
    position: relative;
    overflow: hidden;
}
.archive-thumbnail-container {
    position: relative;
}
.reference-excerpt {
    position: absolute;
    bottom: 3em;
    color: #fff;
    width: 100%;
    background: rgba(0,83,184,0.8);
    background: -moz-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: -webkit-gradient(left top, right top, color-stop(0%, rgba(0,83,184,0.8)), color-stop(57%, rgba(0,83,184,0.7)), color-stop(58%, rgba(0,83,184,0.7)), color-stop(80%, rgba(0,83,184,0.42)), color-stop(100%, rgba(0,83,184,0)));
    background: -webkit-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: -o-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: -ms-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: linear-gradient(to right, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0053b8', endColorstr='#0053b8', GradientType=1 );
}
.reference-excerpt p {
    font-size: 1.2em;
    padding: 0.2em;
    margin-bottom: 0;
}
.reference-title {
    position: absolute;
    top: 0.5em;
    left: 1em;
    color: #0052b8;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px #fff;
    max-width: 90%;
}
.reference-content {
    max-width: 100%;
}
.content-hover { 
    position: relative;
    overflow: hidden;
}
.content-hover img {
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    transition: all .5s linear;
}
.content-hover:hover > img {
    transform: scale(1.5,1.5);
    filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
    filter: gray; /* IE6-9 */
    -webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    transition: all .5s linear;
}
.content-slide:hover + .content-hover img {
    transform: scale(1.5,1.5);
    filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
    filter: gray; /* IE6-9 */
    -webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}
.content-slide:hover, .content-hover:hover + .content-slide {
    top: 0;
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    transition: all .5s linear;
}
.content-slide:hover, .content-hover:hover > .reference-title {
    display: none;
}
.content-slide {
    position: absolute;
    top: -360px;
    -webkit-transition: top 1s;
    -moz-transition: top 1s;
    transition: top 1s;
}
.reference-container {
    position: relative;
    overflow: hidden;
}
.archive-thumbnail-container {
    position: relative;
}
.reference-excerpt {
    position: absolute;
    bottom: 3em;
    color: #fff;
    width: 100%;
    background: rgba(0,83,184,0.8);
    background: -moz-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: -webkit-gradient(left top, right top, color-stop(0%, rgba(0,83,184,0.8)), color-stop(57%, rgba(0,83,184,0.7)), color-stop(58%, rgba(0,83,184,0.7)), color-stop(80%, rgba(0,83,184,0.42)), color-stop(100%, rgba(0,83,184,0)));
    background: -webkit-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: -o-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: -ms-linear-gradient(left, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    background: linear-gradient(to right, rgba(0,83,184,0.8) 0%, rgba(0,83,184,0.7) 57%, rgba(0,83,184,0.7) 58%, rgba(0,83,184,0.42) 80%, rgba(0,83,184,0) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0053b8', endColorstr='#0053b8', GradientType=1 );
}
.reference-excerpt p {
    font-size: 1.2em;
    padding: 0.2em;
    margin-bottom: 0;
}
.reference-title {
    position: absolute;
    top: 0.5em;
    left: 1em;
    color: #0052b8;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px #fff;
    max-width: 90%;
}
.reference-content {
    max-width: 100%;
}
.content-hover { 
    position: relative;
    overflow: hidden;
}
.content-hover img {
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    transition: all .5s linear;
}
.content-hover:hover > img {
    transform: scale(1.5,1.5);
    filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
    filter: gray; /* IE6-9 */
    -webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    transition: all .5s linear;
}
.content-slide:hover + .content-hover img {
    transform: scale(1.5,1.5);
    filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
    filter: gray; /* IE6-9 */
    -webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}
.reference-container:hover > .content-slide {
    top: 0;
    -webkit-transition: all .5s linear;
    -moz-transition: all .5s linear;
    transition: all .5s linear;
}
.content-slide:hover, .content-hover:hover > .reference-title {
    display: -200px;
}
.content-slide {
    position: absolute;
    top: -360px;
    -webkit-transition: top 1s;
    -moz-transition: top 1s;
    transition: top 1s;
}