【发布时间】:2016-04-28 23:57:01
【问题描述】:
我正在尝试重新创建complex.com 中显示的这种效果,在该网站顶部的三个大面板上有一个彩色底部边框。当您将鼠标悬停在面板上时,底部边框的高度在动画效果中会稍微变大。这是我认为产生效果的代码,但仍然对 :after 的作用感到困惑。我只想为面板或 div 的边框设置动画,而不是整个面板/div。
.hero-unit--style:after {
background: #d93347;
}
.hero-unit:after {
display: block;
height: 3px;
background: #000;
transition: height .2s,box-shaddow .2s;
}
.hero-unit:after, .hero-unit__img-shadow {
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
【问题讨论】: