2011-10-04 24 views
24

嗨我想擺脫當您單擊文本字段並開始輸入數據時出現的藍色「閃耀」。這是如何完成的?單擊表單輸入字段時如何擺脫藍色外邊框?

我是初學者,所以我沒那麼有經驗。 我的代碼是:

<input type="text" name="search" size="40" value="Job Title e.g. Assistant Manager" 
style="background-color:white; border: 
solid 1px #6E6E6E; height: 31px; font-size:16px; 
vertical-align:0px;color:#bbb" 
onfocus="if(this.value == 'Job Title e.g. Assistant Manager'){this.value = 
'';this.style.color='#000'}" /> 

謝謝!

詹姆斯

回答

46

CSS段應在所有主要的瀏覽器中工作:

input:focus { 
    outline:none; 
} 

如果沒有,嘗試添加!important指令:

input:focus { 
    outline:none !important; 
} 
4

您只需添加:

<style type="text/css"> 
#hello:focus 
{ 
    outline:none; 
}  
</style> 



<input type="text" id="hello"></input> 

乾杯!

相關問題