gpt4 book ai didi

html - 将鼠标悬停在文本上以使用 css 滚动动画更改文本

转载 作者:太空宇宙 更新时间:2023-11-03 21:03:54 25 4
gpt4 key购买 nike

我想更改此“EMAIL”文本以在鼠标悬停时更改为具有水平滚动动画的特定电子邮件(如“JOHN.SNOW@GMAIL.COM”)。这是 HTML

<div class="wrapper">
<a class="contact" href="#">INSTAGRAM</a>
<a class="contact" href="#">EMAIL</a>
<a class="contact" href="#">CREDITS</a>
</div>

最佳答案

好的,运行下面的代码片段,我用一个overlay做成滚动的效果

试试这个,可能对你有帮助

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.container {
position: relative;
width: 50%;
}

.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: white;
color: black;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}

.container:hover .overlay {
height: 100%;
}

</style>
</head>
<body>


<div class="container">
<div class="">Email</div>
<div class="overlay">
<div class="text">JOHN.SNOW@GMAIL.COM</div>
</div>
</div>

</body>
</html>

关于html - 将鼠标悬停在文本上以使用 css 滚动动画更改文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55994591/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com