hooyantsing's Blog

P171_20_网站动态LOGO制作

字数统计: 223阅读时长: 1 min
2020/04/22

P171 20 网站动态LOGO制作

实战案例

介绍:当鼠标移动到logo时具有颜色背景的字母会旋转。

效果:

339717ea70e535c40879cbd795510198.png

源码:

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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }

        main {
            height: 100vh;
            width: 100vw;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #2c3e50;
        }

        main div {
            cursor: pointer;
            color: white;
            font-size: 2em;
        }

        main div strong {
            height: 80px;
            width: 80px;
            display: inline-block;
            transition: 1s;
            border-radius: 50%;
            text-align: center;
        }

        main div strong:nth-child(1) {
            background: #f1c40f;
        }

        main div:hover strong:nth-child(1) {
            transform: rotate(360deg);
        }

        main div strong:nth-child(2) {
            background: #1abc9c;
        }

        main div:hover strong:nth-child(2) {
            transform: rotate(-360deg);
        }
    </style>
</head>
<body>
<main>
    <div>
        <div>
            <strong>h</strong>ou<strong>d</strong>unren
        </div>
    </div>
</main>
</body>
</html>
CATALOG