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;
    }
  }
相关推荐
符文师20 分钟前
css3 新特性
前端·css3
ct97843 分钟前
WebGL开发
前端·gis·webgl
C_心欲无痕1 小时前
前端页面渲染方式:CSR、SSR、SSG
前端
果粒蹬i1 小时前
生成式 AI 质量控制:幻觉抑制与 RLHF 对齐技术详解
前端·人工智能·easyui
WordPress学习笔记2 小时前
解决Bootstrap下拉菜单一级链接无法点击的问题
前端·bootstrap·html
Never_Satisfied2 小时前
C#插值字符串中大括号表示方法
前端·c#
踢球的打工仔3 小时前
typescript-类
前端·javascript·typescript
天天打码3 小时前
Svelte-无虚拟DOM、极致性能的现代高性能Web开发框架!
前端·node.js·vue·svelte
0思必得03 小时前
[Web自动化] Selenium元素定位
前端·python·selenium·自动化·html
EEEzhenliang4 小时前
CSS知识概括、总结
前端·css