2017-04-12 31 views
0

當我的下劃線閃爍動畫時可以鍵入嗎?它看起來像this動畫之後的類型

我希望能夠訪問該頁面時鍵入。沒有別的,但我不知道這是否可能。我爲此使用動畫或JavaScript嗎?你能幫助我嗎?

@import url('https://fonts.googleapis.com/css?family=Open+Sans'); 
 
* { 
 
    font-family: 'Open Sans', sans-serif; 
 
    font-size: 100px; 
 
    margin: 0; 
 
    padding: 0; 
 
    text-align: center; 
 
} 
 

 
span { 
 
    left: 0; 
 
    line-height: 200px; 
 
    margin-top: -100px; 
 
    top: 50%; 
 
    width: 100%; 
 
} 
 

 
.blinking-cursor { 
 
    font-weight: 100; 
 
    font-size: 100px; 
 
    color: #2E3D48; 
 
    animation: 1s blink step-end infinite; 
 
} 
 

 
@keyframes "blink" { 
 
    from, 
 
    to { 
 
    color: transparent; 
 
    } 
 
    50% { 
 
    color: black; 
 
    } 
 
} 
 

 
@-webkit-keyframes "blink" { 
 
    from, 
 
    to { 
 
    color: transparent; 
 
    } 
 
    50% { 
 
    color: black; 
 
    } 
 
}
<span>Hi there </span><span class="blinking-cursor">_</span>

+1

當然這是可能的。您可以隨時鍵入。即使你的電腦關閉了。你的問題目前不完整。請描述當訪問者輸入時你想在頁面中發生什麼。 –

回答

0

添加contenteditable="true"到div在HTML,你準備好去。