当前位置: 首页 > news >正文

CSS实现文本和图片无限滚动动画

Demo图如下:
在这里插入图片描述

 <style>* {margin: 0;padding: 0;box-sizing: border-box;font-family: 'Poppins', sans-serif;}body {min-height: 100vh;background-color: rgb(11, 11, 11);color: #fff;display: flex;flex-direction: column;justify-content: center;align-items: center;}.scroll {display: flex;width: 700px;overflow: hidden;mask-image: linear-gradient(90deg, transparent, #fff 20%, #fff 80%, transparent);-webkit-mask-image: linear-gradient(90deg, transparent, #fff 20%, #fff 80%, transparent);}.scroll>div span {display: inline-block;margin: 10px;padding: 5px 10px;background-color: #333;border-radius: 5px;letter-spacing: 0.2em;text-transform: uppercase;/* 重置字体大小 */font-size: 16px;cursor: pointer;transition: background-color 0.5s;}.scroll>div span:hover {background-color: #f152ec;}.img-box .img {max-width: 150px;cursor: pointer;transition: filter 0.5s;margin: 10px;}.img-box .img:hover {filter: grayscale(1);}.scroll>div {/* 解决空白间隙将字体设置为0 */font-size: 0;white-space: nowrap;animation: animate var(--time) linear infinite;animation-delay: calc(var(--time) * -1);}/*向右移动*/@keyframes animate {0% {transform: translateX(-100%);}100% {transform: translateX(100%);}}/*向左移动*//* @keyframes animate {0% {transform: translateX(100%);}100% {transform: translateX(-100%);}} */.scroll>div:nth-child(2) {animation: animate2 var(--time) linear infinite;animation-delay: calc(var(--time) / -2);}/*向右移动*/@keyframes animate2 {0% {transform: translateX(-200%);}100% {transform: translateX(0);}}/*向左移动*//* @keyframes animate2 {0% {transform: translateX(0);}100% {transform: translateX(-200%);}} */.scroll:hover>div {animation-play-state: paused;}</style>
<div class="scroll" style="--time: 20s"><div><span>HTML</span><span>CSS</span><span>JavaScript</span><span>Vue</span><span>React</span><span>Figma</span><span>Photoshop</span></div><div><span>HTML</span><span>CSS</span><span>JavaScript</span><span>Vue</span><span>React</span><span>Figma</span><span>Photoshop</span></div></div><div class="scroll" style="--time: 30s"><div><span>HTML</span><span>CSS</span><span>JavaScript</span><span>Vue</span><span>React</span><span>Figma</span><span>Photoshop</span></div><div><span>HTML</span><span>CSS</span><span>JavaScript</span><span>Vue</span><span>React</span><span>Figma</span><span>Photoshop</span></div></div><div class="scroll" style="--time: 10s"><div><span>HTML</span><span>CSS</span><span>JavaScript</span><span>Vue</span><span>React</span><span>Figma</span><span>Photoshop</span></div><div><span>HTML</span><span>CSS</span><span>JavaScript</span><span>Vue</span><span>React</span><span>Figma</span><span>Photoshop</span></div></div><div class="scroll" style="--time: 35s"><div><span>HTML</span><span>CSS</span><span>JavaScript</span><span>Vue</span><span>React</span><span>Figma</span><span>Photoshop</span></div><div><span>HTML</span><span>CSS</span><span>JavaScript</span><span>Vue</span><span>React</span><span>Figma</span><span>Photoshop</span></div></div><div class="scroll img-box" style="--time:25s"><div><div class="img" style="display:inline-block;background:url(./imgs/img1.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img2.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img1.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img2.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img1.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img2.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img1.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img2.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div></div><div><div class="img" style="display:inline-block;background:url(./imgs/img1.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img2.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img1.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img2.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img1.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img2.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img1.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div><div class="img" style="display:inline-block;background:url(./imgs/img2.jpeg) no-repeat center/100% 100%;width: 150px;height:100px;"></div></div></div></div>

相关文章:

CSS实现文本和图片无限滚动动画

Demo图如下&#xff1a; <style>* {margin: 0;padding: 0;box-sizing: border-box;font-family: Poppins, sans-serif;}body {min-height: 100vh;background-color: rgb(11, 11, 11);color: #fff;display: flex;flex-direction: column;justify-content: center;align-i…...

MacOS 无法ping 通 github.com 解决方案

ping github.com 会显示请求超时&#xff1a; PING github.com (192.30.253.112): 56 data bytes Request timeout for icmp_seq 0 Request timeout for icmp_seq 1 Request timeout for icmp_seq 2 Request timeout for icmp_seq 3 Request timeout for icmp_seq 4 Request …...

Mac 也能玩文明6!下载安装详细教程

最近朋友给我分享了一个 Mac 玩文明6的方法&#xff0c;丝毫不卡顿&#xff0c;非常流畅&#xff0c;分享给大家 文明6是最新的文明系列游戏&#xff0c;和以往的文明游戏一样&#xff0c;玩家将从石器时代创建文明&#xff0c;然后迈向信息时代&#xff0c;最终通过军事、经济…...

git tag的用法详解

目录 一、tag标识一个commit 二、查看tag 三、对分支打tag 四、删除tag 五、根据某个tag来clone 一、tag标识一个commit tag是用于去标记一个特定的commit。通常&#xff0c;在进行编译部署之前&#xff0c;我们需要对某一个即将release的版本进行tag&#xff0c;例如tag为…...

TC397 EB MCAL开发从0开始系列 之 [17.1] ETH配置实战 - ping/发送

一、ETH配置1、配置目标2、目标依赖2.1 硬件使用2.2 软件使用2.3 新增模块3、EB配置3.1 配置讲解3.2 模块配置3.2.1 MCU配置3.2.2 PORT配置3.2.3 ETH配置3.2.4 ResourceM配置4、ADS代码编写及调试4.1 工程编译...

Scrapy爬虫在新闻数据提取中的应用

Scrapy是一个强大的爬虫框架&#xff0c;广泛用于从网站上提取结构化数据。下面这段代码是Scrapy爬虫的一个例子&#xff0c;用于从新闻网站上提取和分组新闻数据。 使用场景 在新闻分析和内容聚合的场景中&#xff0c;收集和组织新闻数据是常见需求。例如&#xff0c;如果我…...

【服务器GPT+MJ+GPTs】创建部署GPT+MJ+GPTs程序网站

目录 🌺【前言】 🌺【准备】 🌺【宝塔搭建GPT+MJ+GPTs】 🌼1. 给服务器添加端口 🌼2. 安装宝塔 🌼3. 安装Docker 🌼4. 安装ChatGPT程序 🌼5. 程序更新 🌼6. 修改端口 | 密码 🌼7. 绑定域名+申请SSL证书 🌺【前言】 相信大家都对openai的产品ch…...

C语言零基础入门第2天《 visual studio下载安装教程和搭建开发环境及踩坑指南》(保姆级图文教程)

visual studio下载安装教程和搭建开发环境 1、 项目实战效果图2、简单了解一下目前主流的开发环境3、 visual studio下载地址4、 visual studio安装教程5、 配置visual studio环境变量 6、如何新建一个C项目7、新建第一个C程序8、用代码测试创建的项目是否可用8、如何成功让代码…...

分析Vue3生命周期

一.什么是生命周期 在Vue中&#xff0c;生命周期是组件从创建到销毁的整个过程中的不同阶段。Vue组件的生命周期主要由一系列的钩子函数&#xff08;hook functions&#xff09;组成。 以下是Vue组件生命周期的主要阶段&#xff1a; 1. 创建阶段&#xff1a; - beforeCre…...

Android 13.0 Launcher3 禁止在HotSeat创建Folder文件夹功能实现

1.概述 在13.0的系统rom定制化开发中,在laucher3的某些功能中,在拖拽item时 靠近某个图标时会形成文件夹(folder), 而根据客户需求不想再hotseat形成文件夹, 这就要从workspace.java从来寻找解决方案了分析hotseat是怎么变成 folder的,接下来具体实现相关功能 2.Launch…...

大模型训练 - 华为机试真题第二题(200分)

考试平台&#xff1a; 时习知 题目类型&#xff1a; 3 道编程题 &#xff08;100分 200分 300分&#xff09; 考试时间&#xff1a; 2024-01-24 &#xff08;两小时&#xff09; AI大模型学习大量的训练样本&#xff0c;通过大量参数拟合出样本背后复杂的高维概率密度分布关系…...

创作活动(九十三)———ChatGPT 和文心一言哪个更好用?

#ChatGPT 和文心一言哪个更好用&#xff1f;# 根据提供的搜索结果&#xff0c;ChatGPT和文心一言各有特点和优势&#xff0c;选择哪一个更好用取决于具体的应用场景和个人需求。以下是两者的对比&#xff1a; ChatGPT&#xff1a; 适用场景&#xff1a;适合需要生成大量知识性…...

Spring 声明式事务 @Transactional(详解)【面试重点,小林出品】

关于 Transactional 注解的基本使用&#xff0c;推荐看Spring 声明式事务 Transactional&#xff08;基本使用&#xff09; 概述 本篇博客主要学习 Transactional 注解当中的三个常⻅属性: 1. rollbackFor:异常回滚属性.指定能够触发事务回滚的异常类型.可以指定多个异常类型 …...

CSS之高度塌陷和外边距塌陷

目录 1.高度塌陷&#xff08;原因&#xff0c;如何解决&#xff09; 【概念介绍】 【解决办法】 【概念介绍-BFC】 【拓展-BFC的触发条件】 2.外边距塌陷 &#xff08;原因&#xff0c;如何解决&#xff09; 【概念介绍】 【两种情况】 1.相邻块元素 2.嵌套块元素 【…...

基于SpringBoot Vue美食网站系统

大家好✌&#xff01;我是Dwzun。很高兴你能来阅读我&#xff0c;我会陆续更新Java后端、前端、数据库、项目案例等相关知识点总结&#xff0c;还为大家分享优质的实战项目&#xff0c;本人在Java项目开发领域有多年的经验&#xff0c;陆续会更新更多优质的Java实战项目&#x…...

哪吒汽车与经纬恒润合作升级,中央域控+区域域控将于2024年落地

近日&#xff0c;在2024哪吒汽车价值链大会上&#xff0c;哪吒汽车与经纬恒润联合宣布合作升级&#xff0c;就中央域控制器和区域域控制器展开合作&#xff0c;合作成果将在山海平台新一代车型上发布。 哪吒汽车首席技术官戴大力、经纬恒润副总裁李伟 经纬恒润在智能驾驶领域拥…...

php学习-实战项目

登录注册 login_db_connect.php 连接数据库 <?php //用于登录界面数据库连接 //设置字符集 header(Content-type:text/html;charsetutf8);//连接数据库 $conmysqli_connect("localhost","root","root","lms"); if (mysqli_conne…...

【项目日记(四)】第一层: 线程缓存的具体实现

&#x1f493;博主CSDN主页:杭电码农-NEO&#x1f493;   ⏩专栏分类:项目日记-高并发内存池⏪   &#x1f69a;代码仓库:NEO的学习日记&#x1f69a;   &#x1f339;关注我&#x1faf5;带你做项目   &#x1f51d;&#x1f51d; 开发环境: Visual Studio 2022 项目日…...

海思 tcpdump 移植开发详解

目录 前言 一、开发环境 二、tcpdump 源码下载 三、交叉编译 libpcap 四、交叉编译 tcpdump 五、tcpdump 移植到板子运行 前言 本章内容将讲解&#xff0c;如何在海思平台交叉编译、移植&#xff0c;并基于静态库生成的 tcpdump 网络抓包工具。 一、开发环境 SS…...

Javascript--流程控制

目录 数据类型转换 自动类型转换 强制类型转换 流程控制语句 顺序流程 选择流程 单分支 双分支 多分支 switch 循环流程 for循环 while循环 do...while循环 如何选择 continue和break 循环案例 数据类型转换 由于 javascrip 这个语言它是弱类型语言&#xff0c…...

OpCore Simplify:突破性黑苹果OpenCore配置自动化工具终极指南

OpCore Simplify&#xff1a;突破性黑苹果OpenCore配置自动化工具终极指南 【免费下载链接】OpCore-Simplify A tool designed to simplify the creation of OpenCore EFI 项目地址: https://gitcode.com/GitHub_Trending/op/OpCore-Simplify OpCore Simplify是一款革命…...

无需苹果硬件:用开源工具打造高效macOS虚拟机搭建方案

无需苹果硬件&#xff1a;用开源工具打造高效macOS虚拟机搭建方案 【免费下载链接】OneClick-macOS-Simple-KVM Tools to set up a easy, quick macOS VM in QEMU, accelerated by KVM. Works on Linux AND Windows. 项目地址: https://gitcode.com/gh_mirrors/on/OneClick-m…...

新手零失败指南:基于快马平台生成win10安装openclaw的交互式学习应用

最近在Windows 10上折腾OpenClaw的安装&#xff0c;作为新手真的踩了不少坑。环境配置报错、依赖冲突、权限问题...每次遇到错误都要花大量时间搜索解决方案。后来发现用InsCode(快马)平台可以快速生成带交互指导的安装程序&#xff0c;终于找到了适合新手的打开方式。这里把完…...

OpenClaw技能开发:用GLM-4.7-Flash打造专属翻译助手

OpenClaw技能开发&#xff1a;用GLM-4.7-Flash打造专属翻译助手 1. 为什么需要本地化翻译助手 作为技术文档的频繁使用者&#xff0c;我经常需要在中英文资料间切换查阅。传统翻译工具存在几个痛点&#xff1a;一是商业API的调用限制和隐私顾虑&#xff0c;二是通用翻译对技术…...

Kook Zimage真实幻想Turbo部署教程:免conda环境纯pip安装方案

Kook Zimage真实幻想Turbo部署教程&#xff1a;免conda环境纯pip安装方案 1. 项目简介 Kook Zimage真实幻想Turbo是一款专为个人GPU设计的轻量化幻想风格文生图系统。它基于Z-Image-Turbo官方极速文生图底座&#xff0c;通过特殊技术融合了专属的幻想风格模型权重&#xff0c…...

2026 AI关键词搜索排名优化行业专业测评:中之网科技江苏有限公司——技术驱动,万词霸屏,全链路AI获客解决方案

2026 AI关键词搜索排名优化行业专业测评&#xff1a;中之网科技江苏有限公司——技术驱动&#xff0c;万词霸屏&#xff0c;全链路AI获客解决方案一、测评背景与核心维度随着AI大模型&#xff08;DeepSeek、豆包、腾讯元宝、Kimi、文心一言、通义千问等&#xff09;成为企业获客…...

D3KeyHelper实战指南:从入门到精通的认知跃迁

D3KeyHelper实战指南&#xff1a;从入门到精通的认知跃迁 【免费下载链接】D3keyHelper D3KeyHelper是一个有图形界面&#xff0c;可自定义配置的暗黑3鼠标宏工具。 项目地址: https://gitcode.com/gh_mirrors/d3/D3keyHelper D3KeyHelper是一款专为《暗黑破坏神3》设计…...

SAP CO-PA获利能力分析:关键设置与事务码实战指南

1. SAP CO-PA模块入门&#xff1a;为什么你需要掌握获利能力分析 第一次接触SAP CO-PA模块时&#xff0c;我完全被那些专业术语搞晕了。直到参与了一个零售行业的项目&#xff0c;才真正理解这个模块的价值所在。想象一下&#xff0c;你是一家快消品公司的财务分析师&#xff0…...

FPGA时序优化全攻略:Vivado 2019.2中的建立与保持时间问题解决

FPGA时序优化全攻略&#xff1a;Vivado 2019.2中的建立与保持时间问题解决 在高速FPGA设计中&#xff0c;时序问题往往是工程师面临的最大挑战之一。当设计频率提升到200MHz甚至更高时&#xff0c;建立时间和保持时间的违例会频繁出现&#xff0c;导致设计无法正常工作。本文将…...

OpenFeign性能优化最全实战

Feign 就是动态代理 模板化 HTTP 请求&#xff0c;帮你把接口方法自动转成 HTTP 调用。 完整执行流程&#xff08;8 步&#xff09; 启动时&#xff1a;FeignClient 接口被 Feign 扫描&#xff0c;生成动态代理类 调用时&#xff1a;执行接口方法 → 进入代理类 解析注解&…...