Created
March 11, 2020 14:19
-
-
Save MarceauKa/f63cd04bcfb0ffc58ecef2d97a912e6e to your computer and use it in GitHub Desktop.
Marquee HTML in CSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Marquee</title> | |
<style type="text/css"> | |
* { | |
box-sizing: border-box; | |
padding: 0; | |
margin: 0; | |
} | |
body { | |
overflow: hidden; | |
font-family: monospace; | |
background-color: black; | |
color: white; | |
} | |
@keyframes marquee { | |
0% { transform: translateX(100%); } | |
100% { transform: translateX(-100%); } | |
} | |
.marquee { | |
animation-name: marquee; | |
animation-duration: 5s; | |
animation-timing-function: linear; | |
animation-iteration-count: infinite; | |
animation-direction: alternate; | |
white-space: nowrap; | |
} | |
.marquee:hover { | |
animation-play-state: paused; | |
} | |
div.wrap { | |
border-top: 2px solid white; | |
border-bottom: 2px solid white; | |
padding: 10px 0; | |
} | |
div.marquee { | |
font-size: 2rem; | |
padding: 0 10px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="wrap"> | |
<div class="marquee">Please reach out if you'd like to collaborate. Please reach out if you'd like to collaborate. Please reach out if you'd like to collaborate.</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment