File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed
Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < title > Typewriter Effect</ title >
5+ < link rel ="stylesheet " type ="text/css " href ="style.css ">
6+ </ head >
7+
8+ < body >
9+
10+ < p > Pure Css Typewriter Effect.</ p >
11+
12+ </ body >
13+ </ html >
Original file line number Diff line number Diff line change 1+ body {
2+ background : # 000 ;
3+ color : lime;
4+ }
5+ p {
6+ position : absolute;
7+ top : 50% ;
8+ left : 50% ;
9+ transform : translate (-50% , -50% );
10+ font-size : 24px ;
11+ font-family : arial;
12+ letter-spacing : 2px ;
13+ text-align : center;
14+ box-sizing : border-box;
15+ overflow : hidden;
16+ white-space : nowrap;
17+ border-right : 2px solid white;
18+ animation : typingEffect 4s steps (40 ) 500ms 1 normal,
19+ blinkEffect 500ms steps (40 ) infinite normal;
20+ }
21+ @keyframes typingEffect {
22+ from {
23+ width : 0 ;
24+ }
25+ to {
26+ width : 15em ;
27+ }
28+ }
29+ @keyframes blinkEffect {
30+ from {
31+ border-right-color : white;
32+ }
33+ to {
34+ border-right-color : transparent;
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments