活动时在文本框周围产生发光效果
问题描述:
在文本框内放置光标时,在文本框周围产生发光效果。
例如:只是将光标放在我们的stackoverflow.com的搜索文本框内。
Make glowing effect around the text box while placing the cursor inside the textbox. For example : just place the cursor inside the search textbox in our stackoverflow.com.
它是因为css,但我不知道如何实现它。 。
Its because of css, but i dont know how to achieve it.. Please help me.
答
虽然你在stackoverflow搜索框上观察到的效果可能是特定于浏览器是一种使用CSS实现所需内容的方法 :focus
pseudo class:
While the effect you observe on the stackoverflow search box is probably browser specific (e.g. Google Chrome) there is a way to achieve what you want using the CSS :focus
pseudo class:
#foo:focus { border: 2px solid red; }
<input id="foo" type="text"/>