【发布时间】:2022-02-14 06:55:55
【问题描述】:
Alright, so when I use this code and hover over the object, the transition works. But if I take my mouse OFF of the object, the transition doesn't happen. I've seen other posts talk about this but the solutions don't work.
这是我的 CSS 代码:
.square{
margin-top: 20px;
height: 100px;
width: 400px;
border-radius: 20px;
background:#3d3434;
outline: none;
transition: 0.25s;
}
.square:hover{
outline: 3px solid #21ff46;
}
另外,我对编码和 CSS 还比较陌生。
【问题讨论】:
-
尝试将过渡添加到 .square :hover 以及
-
我尝试将其添加到悬停 - 没有用,问题也没有