Skip to content

pierremouchan/HorizontalScroll-CSS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

HScroll CSS

A dead simple CSS file to create INFINITE HORIZONTAL TEXT SCROLLING ๐Ÿค™

Example

(You have access to examples in this repo)

Requirements

For the wrapper you need to specify a fixed width in CSS and an overflow hidden

<div class="hscroll-wrapper"></div>

For the inner text you need to create two instances with the same content like this :

<div class="hscroll-wrapper">
	<div class="hscroll">HSCROLL - HSCROLL - HSCROLL -&nbsp;</div>
	<div class="hscroll">HSCROLL - HSCROLL - HSCROLL -&nbsp;</div>
</div>

The minimal require CSS code :

Note that the animation property need to be linear and infinite ๐Ÿ‘

.hscroll-wrapper {
	height: fit-content;
	width: 100vw;
	overflow: hidden;
	white-space: nowrap;
}
.hscroll {
	display: inline-block;
	font-size: 200px;
	font-weight: 900;
	animation: hscrollTranslate 10s linear infinite;
	border: 1px solid green;
}

@keyframes hscrollTranslate {
	100% {
		transform: translateX(-100%);
	}
}

TO-DO FUTURE UPDATES :

  • JS Version

About

A dead simple CSS file to create INFINITE HORIZONTAL TEXT SCROLLING ๐Ÿค™

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages