Zum Hauptinhalt springen
•••
IT NachrichtenOnlinebrettspiele: So wird jeder Abend zum Spieleabend!(03.10.2026 um 07:30 Uhr)
•••
IT Security NachrichtenShutdown-Sabotage: KI-Agenten verhindern eigenmächtig ihre Abschaltung(03.10.2026 um 06:05 Uhr)
•
Sichere ProgrammierungTFTP Uses UDP 69—but the File Transfer Uses More Ports(03.10.2026 um 07:12 Uhr)
•
Sichere ProgrammierungMy best-looking resume template scored 0 of 7 in the text layer(03.10.2026 um 07:12 Uhr)
•
Sichere ProgrammierungDHCP Ports Explained: UDP 67/68 for IPv4 and 546/547 for IPv6(03.10.2026 um 07:12 Uhr)
••••
IT NachrichtenOnlinebrettspiele: So wird jeder Abend zum Spieleabend!(03.10.2026 um 07:30 Uhr)
•••
IT Security NachrichtenShutdown-Sabotage: KI-Agenten verhindern eigenmächtig ihre Abschaltung(03.10.2026 um 06:05 Uhr)
•
Sichere ProgrammierungTFTP Uses UDP 69—but the File Transfer Uses More Ports(03.10.2026 um 07:12 Uhr)
•
Sichere ProgrammierungMy best-looking resume template scored 0 of 7 in the text layer(03.10.2026 um 07:12 Uhr)
•
Sichere ProgrammierungDHCP Ports Explained: UDP 67/68 for IPv4 and 546/547 for IPv6(03.10.2026 um 07:12 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Blinking cursor

The blinking cursor animation is a neat trick that makes the text cursor appear and disappear at regular intervals. You've probably seen this effect in text…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

The blinking cursor animation is a neat trick that makes the text cursor appear and disappear at regular intervals.



You've probably seen this effect in text editors, where it shows where new text will appear when you start typing. But that's not the only place it's used! You'll also find it in search bars, where it lets you know you can start typing your question. And in login forms, it tells you which field is ready for your input.



In this post, we'll explore some simple and common ways to create a blinking cursor animation using CSS.






Markup



To add a caret to your webpage, start by creating an HTML element where you want the caret to appear. For instance, you could make a div element with a class of caret.




<div class="caret"></div>






The caret should have some basic styles that determine its dimensions, like height and width. Additionally, it should have a dark background color to resemble a real caret.




.cursor {
background-color: rgb(15 23 42);
width: 0.25rem;
height: 2rem;
}









Blinking animation



There are two common ways to make the caret blink. The first approach is to change the background color repeatedly, back and forth between the original and transparent colors.



It involves creating a blink keyframe to define the animation. This approach keeps the original color in the middle of the animation, but uses a transparent background color at the start and end, making the caret appear invisible.




@keyframes blink {
0%, 100% {
background-color: transparent;
}
50% {
background-color: rgb(15 23 42);
}
}






The animation lasts one second and repeats infinitely.




.cursor {
animation: blink 1s infinite;
}






Now, let's see an example of how this approach works in action.







Another approach to create a blinking effect is to change the opacity property instead of the background color. This animation starts at 100% opacity (fully visible) and ends at 0% opacity (fully invisible), then repeats.



By repeatedly changing the opacity, you can achieve the blinking effect you're looking for.



Let's take a look at the example below to see how this approach works.










See also








If you want more helpful content like this, feel free to follow me:



🔍 CTI & Forensik

Cyber Threat Intelligence & Forensik

ATT&CK-Navigator · IoC-Radar · Exploit-Belege
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
2 Knoten · 1 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Blinking cursor

Thematisch verwandte Begriffe: Blinking, cursor · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag