.wrap { max-width:600px; margin:150px auto; } .type-wrap { font-size:17px; margin:10px auto; padding:20px; } /* code for animated blinking cursor */ .typed-cursor{ opacity: 1; font-weight: 100; -webkit-animation: blink 0.7s infinite; -moz-animation: blink 0.7s infinite; -ms-animation: blink 0.7s infinite; -o-animation: blink 0.7s infinite; animation: blink 0.7s infinite; } @-keyframes blink{ 0% { opacity:1; } 50% { opacity:0; } 100% { opacity:1; } } @-webkit-keyframes blink{ 0% { opacity:1; } 50% { opacity:0; } 100% { opacity:1; } } @-moz-keyframes blink{ 0% { opacity:1; } 50% { opacity:0; } 100% { opacity:1; } } @-ms-keyframes blink{ 0% { opacity:1; } 50% { opacity:0; } 100% { opacity:1; } } @-o-keyframes blink{ 0% { opacity:1; } 50% { opacity:0; } 100% { opacity:1; } } .typed-fade-out{ opacity: 0; animation: 0; transition: opacity .25s; }
采用 typed.js展示文字显示效果