Account Settings
FIRST NAME
[Loading...]
LAST NAME
[Loading...]
EMAIL
[Loading...]
ID
[Loading...] For support purposes only
Share AgencyGenius

We've listed the code documentation below, although we've also created a DIY tool that allows you to create your own infinity text sliders on the 'Tool' tab above.

Step 1: Add HTML, Css

Code
Html
Css
Combined
 <div id="ag-scroller-m9lsa6as-exlv7x"> 
 <div class="scroller-track"> 
 <!-- First set of content --> 
 <div class="content-group content-group-1" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-2" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-3" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-4" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-5" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-6" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-7" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-8" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-9" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-10" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
  
 <!-- Second set of content (duplicate for continuous effect) --> 
 <div class="content-group content-group-1" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-2" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-3" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-4" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-5" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-6" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-7" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-8" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-9" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-10" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 </div> 
 </div> 
 /* Text Scroller Main Styles */ 
 #ag-scroller-m9lsa6as-exlv7x { 
 width: 100%; 
 height: 71px; 
 overflow: hidden; 
 position: relative; 
 background-color: #000000; 
 border-radius: 0px; 
 display: flex; 
 align-items: center; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .scroller-track { 
 display: flex; 
 width: max-content; 
 animation: ag-scroller-m9lsa6as-exlv7x-scroll 40s linear infinite; 
 animation-direction: normal; 
 align-items: center; 
 } 
  
 /* Pause on hover effect */ 
 #ag-scroller-m9lsa6as-exlv7x:hover .scroller-track { 
 animation-play-state: paused; 
 } 
  
 /* Content Group Styles */ 
 #ag-scroller-m9lsa6as-exlv7x .content-group { 
 display: flex; 
 align-items: center; 
 padding: 8px 15px; 
 font-family: inherit; 
 font-size: 42px; 
 font-weight: bold; 
 color: #ffffff; 
 margin-right: 40px; 
 white-space: nowrap; 
 transition: all 0.3s ease; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .content-group:hover { 
 color: #ad24a6; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .content-group img { 
 vertical-align: middle; 
 max-height: 100%; 
 width: auto; 
 object-fit: contain; 
 } 
 /* Divider Styles */ 
 #ag-scroller-m9lsa6as-exlv7x .divider { 
 display: flex; 
 align-items: center; 
 padding: 0 10px; 
 font-family: inherit; 
 font-size: 42px; 
 color: #666; 
 white-space: nowrap; 
 transition: all 0.3s ease; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .divider img { 
 vertical-align: middle; 
 max-height: 100%; 
 width: auto; 
 object-fit: contain; 
 } 
 /* Animation keyframes - fixed speed regardless of content amount */ 
 @keyframes ag-scroller-m9lsa6as-exlv7x-scroll { 
 0% { transform: translateX(0); } 
 100% { transform: translateX(-50%); } 
 } 
 /* Responsive styles */ 
 @media (max-width: 768px) { 
 #ag-scroller-m9lsa6as-exlv7x { 
 height: 63px; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .content-group, 
 #ag-scroller-m9lsa6as-exlv7x .divider { 
 font-size: 37px; 
 padding: 6px 12px; 
 } 
 } 
 @media (max-width: 480px) { 
 #ag-scroller-m9lsa6as-exlv7x { 
 height: 56px; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .content-group, 
 #ag-scroller-m9lsa6as-exlv7x .divider { 
 font-size: 33px; 
 padding: 4px 10px; 
 } 
 } 
 <div id="snippet-h27r1ies"> 
 <!-- HTML SECTION START --> 
 <div id="ag-scroller-m9lsa6as-exlv7x"> 
 <div class="scroller-track"> 
 <!-- First set of content --> 
 <div class="content-group content-group-1" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-2" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-3" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-4" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-5" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-6" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-7" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-8" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-9" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-10" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
  
 <!-- Second set of content (duplicate for continuous effect) --> 
 <div class="content-group content-group-1" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-2" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-3" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-4" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-5" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-6" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-7" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-8" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-9" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 <div class="content-group content-group-10" style="margin-right: 20px;"> 
 COLLECTIONS 
 </div> 
 <div class="divider" style="margin-right: 20px;"> 
 👕 
 </div> 
 </div> 
 </div> 
 <!-- HTML SECTION END --> 
  
 <!-- CSS SECTION START --> 
 <style> 
 /* Text Scroller Main Styles */ 
 #ag-scroller-m9lsa6as-exlv7x { 
 width: 100%; 
 height: 71px; 
 overflow: hidden; 
 position: relative; 
 background-color: #000000; 
 border-radius: 0px; 
 display: flex; 
 align-items: center; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .scroller-track { 
 display: flex; 
 width: max-content; 
 animation: ag-scroller-m9lsa6as-exlv7x-scroll 40s linear infinite; 
 animation-direction: normal; 
 align-items: center; 
 } 
  
 /* Pause on hover effect */ 
 #ag-scroller-m9lsa6as-exlv7x:hover .scroller-track { 
 animation-play-state: paused; 
 } 
  
 /* Content Group Styles */ 
 #ag-scroller-m9lsa6as-exlv7x .content-group { 
 display: flex; 
 align-items: center; 
 padding: 8px 15px; 
 font-family: inherit; 
 font-size: 42px; 
 font-weight: bold; 
 color: #ffffff; 
 margin-right: 40px; 
 white-space: nowrap; 
 transition: all 0.3s ease; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .content-group:hover { 
 color: #ad24a6; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .content-group img { 
 vertical-align: middle; 
 max-height: 100%; 
 width: auto; 
 object-fit: contain; 
 } 
 /* Divider Styles */ 
 #ag-scroller-m9lsa6as-exlv7x .divider { 
 display: flex; 
 align-items: center; 
 padding: 0 10px; 
 font-family: inherit; 
 font-size: 42px; 
 color: #666; 
 white-space: nowrap; 
 transition: all 0.3s ease; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .divider img { 
 vertical-align: middle; 
 max-height: 100%; 
 width: auto; 
 object-fit: contain; 
 } 
 /* Animation keyframes - fixed speed regardless of content amount */ 
 @keyframes ag-scroller-m9lsa6as-exlv7x-scroll { 
 0% { transform: translateX(0); } 
 100% { transform: translateX(-50%); } 
 } 
 /* Responsive styles */ 
 @media (max-width: 768px) { 
 #ag-scroller-m9lsa6as-exlv7x { 
 height: 63px; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .content-group, 
 #ag-scroller-m9lsa6as-exlv7x .divider { 
 font-size: 37px; 
 padding: 6px 12px; 
 } 
 } 
 @media (max-width: 480px) { 
 #ag-scroller-m9lsa6as-exlv7x { 
 height: 56px; 
 } 
 #ag-scroller-m9lsa6as-exlv7x .content-group, 
 #ag-scroller-m9lsa6as-exlv7x .divider { 
 font-size: 33px; 
 padding: 4px 10px; 
 } 
 } 
 </style> 
 <!-- CSS SECTION END --> 
 </div> 

Infinite Text Scroller Overview

The Infinite Text Scroller creates a horizontally scrolling text banner with a continuous animation effect. It's designed to showcase repetitive content in an eye-catching way, commonly used for announcements, branding elements, or highlighting key features.

HTML Structure

The HTML structure is straightforward:

  • The main container ag-scroller-m9lsa6as-exlv7x wraps the entire component
  • Inside is a .scroller-track div that holds all content
  • Content is organized into two types of elements:
    • .content-group elements containing the primary text ("COLLECTIONS")
    • .divider elements containing emoji separators (👕)
  • Content is duplicated to create the seamless looping effect (two identical sets)
CSS Animation

The scrolling effect is achieved entirely through CSS:

  • The main container has overflow: hidden to create a viewport window
  • The .scroller-track uses width: max-content to accommodate all content
  • Animation is applied to the track with animation: ag-scroller-m9lsa6as-exlv7x-scroll 40s linear infinite
  • The keyframe animation moves content from right to left by transforming the X position:
    • 0% { transform: translateX(0); }
    • 100% { transform: translateX(-50%); }
  • The -50% value ensures that exactly half of the duplicated content scrolls by, creating a seamless loop
Interactive Features

The scroller includes several user interaction enhancements:

  • Pause on hover: animation-play-state: paused stops the animation when users hover over the scroller
  • Color change on hover: .content-group:hover { color: #ad24a6; } provides visual feedback
  • Smooth transitions: transition: all 0.3s ease ensures changes happen smoothly
Styling Details

The visual design incorporates several key elements:

  • Dark background ( #000000 ) with contrasting white text for maximum visibility
  • Bold typography with large font size ( 42px ) for impact
  • Consistent spacing with margin and padding values maintaining rhythm
  • Flexbox layout for vertical alignment of all elements
  • Support for both text and image content (with object-fit: contain for images)
Responsive Design

The scroller adapts to different screen sizes using media queries:

  • Tablet view ( max-width: 768px ):
    • Reduced height ( 63px )
    • Smaller font size ( 37px )
    • Adjusted padding ( 6px 12px )
  • Mobile view ( max-width: 480px ):
    • Further reduced height ( 56px )
    • Even smaller font size ( 33px )
    • Minimal padding ( 4px 10px )
Implementation Benefits

This scroller solution offers several advantages:

  • CSS-only animation avoids JavaScript dependencies, improving performance
  • Constant speed animation regardless of content length due to percentage-based translation
  • Fully responsive design adapts to any container width
  • Visual emphasis on content with appropriate spacing and typography
  • Self-contained component that can be placed in any position in your layout
  • No external libraries required, keeping the implementation lightweight
Customization Options

The scroller can be easily customized in several ways:

  • Change animation speed by modifying the 40s value in the animation property
  • Adjust colors for background, text, and hover states
  • Modify font size, weight, and family to match your design system
  • Customize the divider symbol (currently using the 👕 emoji)
  • Add border-radius or other styling to change the visual appearance
  • Adjust the spacing between content groups for different visual rhythm
  • Replace text with images or icons for more visual variety
Video Thumbnail

How to edit code using AI

Resource Details:
Infinite Text Scroller creates a smooth, continuously moving text banner for your website. Text scrolls horizontally in an endless loop with pause-on-hover functionality and color-change effects. Built with pure CSS animations for optimal performance, it features responsive design for all screen sizes, customizable speed, and styling options. Perfect for announcements, featuring product collections, or highlighting key information with a dynamic, eye-catching presentation.

Last Updated:

April 17th 2025

Category:

Marquees & Scrollers

Need Help?

Join Slack

Callum Wells
Callum Wells
i
Creator Credits
We always strive to credit creators as accurately as possible. While similar concepts might appear online, we aim to provide proper and respectful attribution.
A black padlock with a keyhole on a white background.

NO-ACCESS

Only for Desktop Users

This page is only available on desktop.

Please Log in on a desktop to gain access.