在博客上使用黑条字

本文所有代码均来自萌娘百科

介绍

黑条字指默认情况下是一个黑条,把鼠标悬停在黑条字上显示被遮挡的文字。

示例

文字

使用方法

将一下代码放到页面的css中

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.heimu, .heimu a, a .heimu, .heimu a.new {
background-color: #252525;
color: #252525;
text-shadow: none;
}
.heimu:hover, .heimu:active,
.heimu:hover .heimu, .heimu:active .heimu {
color: white !important;
}
.heimu:hover a, a:hover .heimu,
.heimu:active a, a:active .heimu {
color: lightblue !important;
}
.heimu:hover .new, .heimu .new:hover, .new:hover .heimu,
.heimu:active .new, .heimu .new:active, .new:active .heimu {
color: #BA0000 !important;
}

在字的前面加上
<span class="heimu" title="此处为悬浮在黑条上显示的字">
在字的后面加上
</span>
即可


在博客上使用黑条字
https://endercat.eu.org/2023/03/18/在博客上使用黑条字/
作者
endercat
发布于
2023年3月18日
许可协议