You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.0 KiB
47 lines
1.0 KiB
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>文字穿透</title>
|
|
<style>
|
|
*{
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
html,body{
|
|
position: relative;
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
body{
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: #333;
|
|
}
|
|
#show{
|
|
position: relative;
|
|
|
|
}
|
|
#bg{
|
|
position: absolute;
|
|
}
|
|
.text-show{
|
|
font-size: 5rem;
|
|
-webkit-background-clip: text;
|
|
color: transparent;
|
|
}
|
|
#bg-son-bg{
|
|
position: absolute;
|
|
height: 100%;
|
|
width: 50%;
|
|
background: aliceblue;
|
|
-webkit-background-clip: text;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="bg" class="text-show"><div id="bg-son-bg"></div><div>Hello World!</div></div>
|
|
<div id="show" class="text-show">Hello World!</div>
|
|
</body>
|
|
</html> |