CSS闪现效果超过图像

时间:2015-11-05 14:03:27

标签: css css3

是否可以在图像上创建这样的“flash”,只使用CSS?

我试过-webkit-filter,但这看起来不太好。

enter image description here

1 个答案:

答案 0 :(得分:1)

你的意思是这样的:

div {
  background: url(http://lorempixel.com/400/400);
  width: 400px;
  height: 400px;
  position: relative;
}
div:after {
  position: absolute;
  height: 80px;
  width: 160px;
  background: rgba(255, 255, 255, 0.7);
  content: " ";
  top: calc(50% - 40px);
  left: calc(50% - 80px);
  border-radius: 50%;
  box-shadow: 0px 0px 50px 50px rgba(255, 255, 255, 0.7);
}
<div></div>

相关问题