I am trying to achieve a typewriter effect on my text, but the blinking cursor is extending further than the actual text.
Here is the code I am using:
HTML:
<div class="title">
<h1>Hi, I'm ConnerDE</h1>
</div>
CSS:
.title h1 {
color: #fff;
font-family: monospace;
overflow: hidden;
border-right: .15em solid orange;
white-space: nowrap;
margin: 0 auto;
letter-spacing: .15em;
animation: typing 3.5s steps(16, end), blink-caret .5s step-end infinite;
}
@keyframes typing {
from {
width: 0
}
to {
width: 100%
}
}
@keyframes blink-caret {
from,
to {
border-color: transparent
}
50% {
border-color: orange
}
}
The flashing caret should stop right at the end of the text.