2011-06-14 74 views
6

可能重複:
input focus outer glowCSS:雙邊框,如何

如何做到這一點的CSS?在focus it looks like it has一個double border ...

Login Form

+0

我認爲這涵蓋了它很好:[http:// stackoverf low.com/questions/4750477/input-focus-outer-glow](http://stackoverflow.com/questions/4750477/input-focus-outer-glow) – 2011-06-14 02:10:08

回答

1
input:focus { property to apply } 

一個live example check out的followng fiddle: http://jsfiddle.net/L5xvJ/

input:focus { 
border: 1px solid #0af; 
outline: none; 
-moz-box-shadow: 0px 0px 15px rgba(0, 170, 255,.5); 
-webkit-box-shadow: 0px 0px 15px rgba(0, 170, 255,.5); 
box-shadow: 0px 0px 15px rgba(0, 170, 255,.5); } 

notet:focus should not是困惑與:主動 - > What is the difference between :focus and :active?

+0

酷,一個-1具有相同的答案其他人有...是因爲我第一次? – matchew 2011-06-14 02:21:37

+1

雖然不是我,但很容易明白爲什麼你的原始答案是低估的:它根本沒有回答這個問題。 – jeroen 2011-06-14 02:33:41

+0

好吧,你是對的,我沒有做正確的事情。但我試圖用正確的方向指出他:焦點和盒子影 – matchew 2011-06-14 02:40:48