Blink Cursor
CSS
Medium
3 views
Problem Description
Make a blinking cursor using animation on border color.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use keyframes to toggle opacity or border color.
Official Solution
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>meetcode</title>
<style>
@keyframes blink { 50% { border-color: transparent; } }
.cursor { display: inline-block; border-right: 2px solid #0b5; padding-right: 4px; animation: blink 700ms step-end infinite; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
</style>
</head>
<body>
<span class='cursor'>meetcode</span>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!