小编Mis*_*ker的帖子

鼠标离开时的 CSS 动画

所以我正在尝试做一些像tiles或者netflix那样的事情。我有一个盒子,我试图让它在鼠标悬停时变大,并在鼠标离开时缩小尺寸。到目前为止我有这个。

.nav {
  position: relative;
  top: 25%;
  width: 100%;
  color: black;
  text-align: center;
}
.nav a {
  color: white;
  text-decoration: none;
}
.link {
  font-size: 24px;
  width: 100%;
  height: 25%;
  background: linear-gradient(135deg, #87e0fd 0%, #53cbf1 40%, #05abe0 100%);
  display: inline;
  padding-right: 12.5%;
  padding-left: 12.5%;
  padding-bottom: 6.25%;
  padding-top: 6.25%;
  box-shadow: 0px 0px 10px 5px grey;
  animation-name: downsize;
  animation-duration: .5s;
  animation-iteration-count: 1;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
}
.link:hover {
  animation-name: resize;
  animation-duration: .5s;
  animation-iteration-count: 1;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
  font-size: 32px;
  padding-right: …
Run Code Online (Sandbox Code Playgroud)

html css css-animations

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

css ×1

css-animations ×1

html ×1