css实现标题跑马灯效果

css实现标题跑马灯效果

javascript 复制代码
      <div class="topBar">
        <span class="scrolling-text">滚动字幕</span>
      </div>
javascript 复制代码
@keyframes marquee {
  0% {
    transform: translateX(300%);
  }

  100% {
    transform: translateX(-300%);
  }
}

  .topBar {
    width:100%;
    height: 45px;
    line-height: 45px;
    background: #FFE6CC;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    color: $fontCoco;
    overflow: hidden;
    position: relative;

    .scrolling-text {
      display: inline-block;
      white-space: nowrap;
      animation: marquee 30s linear infinite;
    }

    .scrolling-text:hover {
      animation-play-state: paused;
      cursor: pointer;
    }
  }
相关推荐
宿6744 小时前
vue3-包管理器
前端·vue.js
@PHARAOH5 小时前
WHAT - Remix 入门和基本实践:理解两套产物
前端·remix
mayaairi5 小时前
Vue2 生命周期完全指南:从创建到销毁的8个钩子函数
前端·javascript·vue.js
xy34536 小时前
axure9.0 如何打造一个计时器(简单版)
前端·ui·html·axure·原型·产品设计
IMPYLH6 小时前
HTML 的 <pre> 元素
前端·javascript·html
tsumikistep7 小时前
【前端】Vue + Axios 跨域问题实战:7070 代理转发 8080 + 401 报错分析(黑马外卖)
前端·javascript·vue.js
lichenyang4537 小时前
鸿蒙首页从等高商品 Grid 到双列瀑布流:同一张图也能做出小红书式浏览节奏
前端
里欧跑得慢8 小时前
Flutter主题与样式详解
前端·css·flutter·web
toooooop88 小时前
智慧文旅数字人体验平台demo html
css·css3
计算机魔术师8 小时前
TPU推理性价比翻50%,NVIDIA的护城河要见底了?
前端