【发布时间】:2018-12-29 11:07:54
【问题描述】:
我正在尝试添加过渡,但无法使其正常工作。我的悬停工作略有不同,因为它针对不同的类进行更改,它是:
.news-thumbnail:hover > .news-description-container{
padding: 1.5rem 2rem;
height: 21rem;
-webkit-transition: all 2s linear;
-moz-transition: all 2s linear;
-o-transition: all 2s linear;
transition: all 2s linear;
}
Edit: adding original class
.news-description-container{
position:absolute;
width: 100%;
bottom: 0;
border-bottom-right-radius: 1rem;
border-bottom-left-radius: 1rem;
background-color: white;
padding:2.5rem 2rem;
text-align: left;
height: 15.5rem;
}
这使得: https://i.stack.imgur.com/DyeOS.png
当您将鼠标悬停在其中时(新闻缩略图),只需白色区域(新闻描述容器)向上滑动: https://i.stack.imgur.com/Q6mxf.png
我怎样才能使这个过渡工作?我只是希望它上下滑动,而不是在没有过渡的情况下出现/消失。
也许我做错了,不应该这样做? 谷歌搜索后没有找到任何东西,所以它可能对其他人有用。
谢谢!
【问题讨论】:
-
你能提供你的问题的重现吗?组件的未悬停 css 应该会有所帮助
标签: css class hover transition target