logo文字图片倒影
废话不多说,先看效果

实现逻辑:
- 图片倒影使用
mask-image属性给图片添加渐变蒙层 - 文字倒影使用
background-image添加背景渐变,使用-webkit-text-fill-color和background-clip将背景颜色裁剪到文字上
代码如下:
<div class="logo-line">
<img class="logo" src="https://lhost.oss-cn-chengdu.aliyuncs.com/blog/logo.png" />
<span class="text">deepseek</span>
</div>
<div class="inverted-line">
<img class="logo" src="https://lhost.oss-cn-chengdu.aliyuncs.com/blog/logo.png" />
<span class="text">deepseek</span>
</div>
<style>
body {
padding: 24px 60px;
}
.logo-line,.inverted-line {
display: flex;
align-items: center;
}
.logo {
margin-right: 4px;
width: 56px;
height: 41px;
}
.text {
color: #4D6BFE;
font-weight: bold;
font-family:-apple-system,BlinkMacSystemFont,"PingFang SC",Arial;
letter-spacing: 0.1rem;
font-size: 2rem;
}
.inverted-line {
margin-top: 2px;
}
.inverted-line .logo {
transform: rotateX(180deg);
mask-image:linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.3) 100%);
}
.inverted-line .text {
display: inline-block;
transform: rotateX(180deg);
background-image: -webkit-linear-gradient(bottom, #4D6BFE66 0%, #fff 100%);
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
}
</style>
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
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
上次更新: 2025/09/05, 8:09:00