blinking cursor with css
27.07.2023 1 min readCreate the “cursor” with border-right
:
span {
padding: 1rem;
border-right: 1px solid white;
}
Make it blink with an animation by removing and adding a border:
span {
padding: 1rem;
border-right: 1px solid white;
animation: blink 1s linear infinite;
}
@keyframes blink {
0% {
border-right: none;
}
100% {
border-right: 1px solid white;
}
}
Built with Astro and Tailwind 🚀