Skip to content

Instantly share code, notes, and snippets.

@eoikonomou
Created January 21, 2020 10:12
Show Gist options
  • Save eoikonomou/14c1adca59e60f230144dde8380928c6 to your computer and use it in GitHub Desktop.
Save eoikonomou/14c1adca59e60f230144dde8380928c6 to your computer and use it in GitHub Desktop.
Maquee effect (Scrolling text)
<!DOCTYPE html>
<html>
<title>Marque effect</title>
<head>
<style>
div {
background-color: #1c87c9;
color: #fff;
padding: 5px;
width: 400px;
}
p {
-moz-animation: marquee 30s linear infinite;
-webkit-animation: marquee 30s linear infinite;
animation: marquee 30s linear infinite;
}
@-moz-keyframes marquee {
0% { transform: translateX(110%); }
50% { transform: translateX(-100%); }
100% { transform: translateX(110%); }
}
@-webkit-keyframes marquee {
0% { transform: translateX(110%); }
50% { transform: translateX(-100%); }
100% { transform: translateX(110%); }
}
@keyframes marquee {
0% {
-moz-transform: translateX(110%);
-webkit-transform: translateX(110%);
transform: translateX(110%) }
50% {
-moz-transform: translateX(-100%);
-webkit-transform: translateX(-100%);
transform: translateX(-100%); }
100% {
-moz-transform: translateX(110%);
-webkit-transform: translateX(110%);
transform: translateX(110%);
}
}
</style>
</head>
<body>
<div>
<p>This is a horizontally scrolling text without the marquee tag.</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment