css3怎么写光晕效果

html-css018

css3怎么写光晕效果,第1张

1, css3圆形光环闪烁效果。

2,文件引用:,

<style type="text/css">

body{background: #EF7148}

img{cursor:pointer-webkit-animation: scaleout 1.3s infinite ease-in-outanimation: scaleout 1.3s infinite ease-in-out}

@-webkit-keyframes scaleout {

0% { -webkit-transform: scale(1.0) }

100% {

-webkit-transform: scale(1.1)

opacity: 0

}

}

@keyframes scaleout {

0% {

transform: scale(1.0)

-webkit-transform: scale(1.0)

} 100% {

transform: scale(1.1)

-webkit-transform: scale(1.1)

opacity: 0

}

}

</style>

1、首先新建一个html空白文档,取名字叫做css3动画,保存一下。

2、然后写html结构,只需要一个div元素即可,class名字叫做img

3、设置其边框为不同的颜色,边框宽度设置成100px。

4、因为是圆环,所以我们用到了css3的圆角效果,设置圆角为50%,也就是border-radius:50%,看一下效果。

5、接下来就是关键的步骤了,也就是添加动画效果。输入以下代码

6、来看一下最后的效果,还是不错的。