2015-01-20 93 views

回答

2

這可以完全使用CSS完成。 (「紅色」已經很可能是CSS)。這裏有一些我喜歡使用的代碼來給出一個很好的「緩和」的輝光來形成元素。

input[type=text] { 
    height: 30px; 
} 

input[type=text], textarea { 
    padding: 6px 12px; 
    font-size: 14px; 
    line-height: 1.428571429; 
    color: #555; 
    vertical-align: middle; 
    background-color: #fff; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    outline: none; 
    -webkit-transition: all 0.30s ease-in-out; 
    -moz-transition: all 0.30s ease-in-out; 
    -ms-transition: all 0.30s ease-in-out; 
    -o-transition: all 0.30s ease-in-out; 
} 

input[type=text]:focus, textarea:focus { 
    box-shadow: 0 0 5px rgba(81, 203, 238, 1); 
    border: 1px solid rgba(81, 203, 238, 1); 
} 
相關問題