当前位置: 代码迷 >> 综合 >> css 音乐文字颜色的过渡效果(从左到右)
  详细解决方案

css 音乐文字颜色的过渡效果(从左到右)

热度:0   发布时间:2024-02-13 04:18:14.0

效果图:
在这里插入图片描述
在这里插入图片描述

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.container {width: 400px;height: 400px;border: 1px solid red;text-align: center;display: flex;justify-content: center;align-items: center;flex-direction: column;}.hover span {color: #ccc;}.hover {position: absolute;top: 0;left: 0;color: blue;overflow: hidden;width: 100%;white-space: nowrap;animation: test 5s;}@keyframes test {from {width: 0%;}to {width: 100%;}}</style>
</head><body><div class="container"><div style="position: relative;"><span style="position: relative;">滚动的歌词滚动的歌词1<span class="hover">滚动的歌词滚动的歌词1</span></span></div></div>
</body></html>
<script></script>