css3填充式动画特效

CSS3填充式动画特效是使用CSS3来制作填充式动画的一种技术。这种技术可以用来制作各种样式的按钮、图标等网页元素,为网页设计师提供了更多的设计选择和更加丰富的效果。

按钮样式:

.button {
  display: inline-block;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  background: #4caf50;
  color: #fff;
  border-radius: 5px;
  -webkit-transition: all 0.3s ease-out;
  transition: all 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.button:hover:after {
  height: 100%;
}

.button:after {
  content: "";
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 0;
  background: #fff;
  z-index: -1;
  -webkit-transition: all 0.3s ease-out;
  transition: all 0.3s ease-out;
}

图标样式:

.icon {
  width: 40px;
  height: 40px;
  position: relative;
  display: inline-block;
}

.icon:after {
  content: "";
  position: absolute;
  left: calc(50% - 5px);
  top: 5px;
  width: 10px;
  height: 10px;
  background: #4caf50;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
  -webkit-transition: all 0.3s ease-out;
  transition: all 0.3s ease-out;
}

.icon:hover:after {
  top: calc(50% - 5px);
  width: 100%;
  left: 0;
  background: #fff;
}

css3填充式动画特效

通过使用CSS3填充式动画特效,我们可以制作出更加生动和丰富的网页元素。同时,这种技术也能够增强用户体验,并提高网站的交互性。

相关文章

Css常用的排序方式权重分配 排序方式: 1、按类型 ...
原文:https://www.cnblogs.com/wenruo/p/9732704.html 先上...
css属性:word-wrap:break-word; 与 word-break:break-all 的...
https://destiny001.gitee.io/color/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...
css之background的cover和contain的缩放背景图 对于这两个属...