CSS怎么设置字体发光效果


当前第2页 返回上一页

HTML代码

1

2

3

<div class="container">

    <p>xinpureZhu</p>

</div>

CSS代码

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

body {

    background: #000;

}

.container {

    width: 600px;

    margin: 100px auto 0;

}

p {

    font-family: 'Audiowide';

    text-align: center;

    color: #00a67c;

    font-size: 7em;

    -webkit-transition: all 1.5s ease;

            transition: all 1.5s ease;

}

p:hover {

    color: #fff;

    -webkit-animation: Glow 1.5s ease infinite alternate;

            animation: Glow 1.5s ease infinite alternate;

}

@-webkit-keyframes Glow {

    from {

        text-shadow: 0 0 10px #fff,

                     0 0 20px #fff,

                     0 0 30px #fff,

                     0 0 40px #00a67c,

                     0 0 70px #00a67c,

                     0 0 80px #00a67c,

                     0 0 100px #00a67c,

                     0 0 150px #00a67c;

    }

    to {

        text-shadow: 0 0 5px #fff,

                     0 0 10px #fff,

                     0 0 15px #fff,

                     0 0 20px #00a67c,

                     0 0 35px #00a67c,

                     0 0 40px #00a67c,

                     0 0 50px #00a67c,

                     0 0 75px #00a67c;

    }

}

@keyframes Glow {

    from {

        text-shadow: 0 0 10px #fff,

                     0 0 20px #fff,

                     0 0 30px #fff,

                     0 0 40px #00a67c,

                     0 0 70px #00a67c,

                     0 0 80px #00a67c,

                     0 0 100px #00a67c,

                     0 0 150px #00a67c;

    }

    to {

        text-shadow: 0 0 5px #fff,

                     0 0 10px #fff,

                     0 0 15px #fff,

                     0 0 20px #00a67c,

                     0 0 35px #00a67c,

                     0 0 40px #00a67c,

                     0 0 50px #00a67c,

                     0 0 75px #00a67c;

    }

}

效果示图

1.gif

(学习视频分享:css视频教程)

以上就是CSS怎么设置字体发光效果的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

教你一招搞定css背景图的大小

如何使用jquery设置css宽度

css怎么让文字居中

带你玩转css中各种方向小箭头

css background-blend-mode属性怎么用?

css中如何调整图片位置

css如何实现元素不随滚动条滚动

css grid-columns属性怎么用

css word-break属性怎么用

css 怎么可以不继承样式

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...