Created
November 17, 2014 15:00
-
-
Save klauskpm/43ee9be0001e8e65faa6 to your computer and use it in GitHub Desktop.
Creates a simple 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
.cursor-box, div, h3{ | |
float: left; | |
clear: left; | |
} | |
.cursor-box .title::after { | |
content: ""; | |
padding: 0px 4px; | |
background: black; | |
margin: 0 0 0 3px; | |
animation: blink 1s steps(5, start) infinite; | |
-webkit-animation: blink 1s steps(5, start) infinite; | |
-moz-animation: blink 1s steps(5, start) infinite; | |
} | |
@keyframes blink { | |
to { visibility: hidden; } | |
} | |
@-webkit-keyframes blink { | |
to { visibility: hidden; } | |
} | |
@-moz-keyframes blink { | |
to { visibility: hidden; } | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="blink-cursor.css"> | |
</head> | |
<body> | |
<h3>Working example:</h3> | |
<div class="cursor-box"> | |
<p class="title">Look at this! It's so beautiful</p> | |
</div> | |
<h3>Wrong implementation:</h3> | |
<div class="cursor-box"> | |
<p>Doesn't use class <b>title</b></p> | |
</div> | |
<div> | |
<p class="title">Doesn't use class <b>cursor-box</b></p> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment