Last active
March 14, 2022 20:04
-
-
Save perezdans/8678121a57f280a3673365feaf6165fa to your computer and use it in GitHub Desktop.
Conseguir un efecto de escritura con css
This file contains 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>CSS Tricks & Tips</title> | |
<meta charset="UTF-8" /> | |
<style> | |
.typing { | |
height: 80vh; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} | |
.typing-effect { | |
width: 22ch; | |
animation: typing 2s steps(22), effect .5s step-end infinite alternate; | |
white-space: nowrap; | |
overflow: hidden; | |
border-right: 3px solid; | |
font-family: monospace; | |
font-size: 2em; | |
} | |
@keyframes typing { | |
from { | |
width: 0 | |
} | |
} | |
@keyframes effect { | |
50% { | |
border-color: transparent | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div class="typing"> | |
<div class="typing-effect"> | |
Typing effect for text | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment