我试图将元素悬停在其上方时显示左边框。目前,我将其设置为使用顶部边框作为分隔线,并且将右侧,底部和左侧边框设置为0。
.post.reply {
font-family: 'Arial', sans-serif !important;
font-size: 8pt !important;
background: #fafafa !important;
color: #1a1a1a !important;
width: 100% !important;
border-bottom: 0 !important;
border-top: 3 !important;
border-left: 0 !important;
border-right: 0 !important;
border-color: #cecece !important;
}
这是悬停
.post.reply:hover {
box-shadow: #444 0 0 0px !important;
border-left: 4px !important;
}
悬停部分的其他操作正常,但是边框拒绝显示。我几乎可以肯定这是因为我在上面设置了0,但是在悬停时它不应该有所不同吗?任何帮助表示赞赏。
这就是您的整体CSS应该如何,并且可以完美运行:
.post.reply {
font-family: 'Arial', sans-serif !important;
font-size: 8pt !important;
background: #fafafa !important;
color: #1a1a1a !important;
width: 100% !important;
border-top: 3px solid #cecece !important;
border-bottom: none !important;
border-left: none !important;
border-right: none !important;
}
.post.reply:hover {
box-shadow: #444 0 0 0px !important;
border-left: 4px solid #cecece !important;
}
我还创建了一个快速的jsFiddle供您查看。此外,!important
如果确实不需要它们,则应删除所有。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句