Last active
December 14, 2015 23:49
-
-
Save AkashSaikia/5168817 to your computer and use it in GitHub Desktop.
Simple Css3 based Blinking Cursor
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
Simple cursor based on Css3. | |
To test it, simply download the file and open in any of the latest browsers. | |
Browser Support : | |
Firefox 5+, IE 10+, Chrome, Safari 4+, Opera 12+ | |
Learnings based on : | |
http://css-tricks.com/snippets/css/keyframe-animation-syntax/ | |
http://coding.smashingmagazine.com/2011/05/17/an-introduction-to-css3-keyframe-animations/ | |
This example is based on some articles and learnings, and have been used in my code too. So i do not own this code. |
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
selection_cursor { | |
display: inline-block; | |
background: #111; | |
-webkit-animation: blink 1.2s linear 0s infinite; | |
-moz-animation: blink 1.2s linear 0s infinite; | |
-ms-animation: blink 1.2s linear 0s infinite; | |
-o-animation: blink 1.2s linear 0s infinite; | |
width:1px; | |
} | |
@-webkit-keyframes blink { | |
0% { opacity: 1; } | |
50% { opacity: 1; } | |
50.01% { opacity: 0; } | |
100% { opacity: 0; } | |
} | |
@-moz-keyframes blink { | |
0% { opacity: 1; } | |
50% { opacity: 1; } | |
50.01% { opacity: 0; } | |
100% { opacity: 0; } | |
} | |
@-ms-keyframes blink { | |
0% { opacity: 1; } | |
50% { opacity: 1; } | |
50.01% { opacity: 0; } | |
100% { opacity: 0; } | |
} | |
@-o-keyframes blink { | |
0% { opacity: 1; } | |
50% { opacity: 1; } | |
50.01% { opacity: 0; } | |
100% { opacity: 0; } | |
} | |
@keyframes blink { | |
0% { opacity: 1; } | |
50% { opacity: 1; } | |
50.01% { opacity: 0; } | |
100% { opacity: 0; } | |
} |
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
<html> | |
<title>Simple css3 based blinking cursor</title> | |
<head> | |
<link rel="stylesheet" type="text/css" href="custom_cursor.css"> | |
</head> | |
<body> | |
<pre> | |
<div class="selection_cursor" ></div> | |
</pre> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment