关于html:禁用Webkit表单输入阴影

Disabling Webkit Form Input Shadow

本问题已经有最佳答案,请猛点这里访问。

Possible Duplicate:
How to remove border around text/input boxes? (Chrome)

当表单元素收到焦点时,是否有方法禁用WebKit浏览器生成的彩色阴影?它是黄色的铬和蓝色的Safari,并在我尝试实现的任何自定义焦点样式的方式。


试试这个:

1
2
3
input:focus {
    outline: none;
}


您可以尝试使用outline: none,但请注意,出于可用性的原因,这通常不是真正需要的。始终牢记Jakob Nielsen的"Web用户体验法则":

Users spend most of their time on other websites.

This means that they form their expectations for your site based on what's commonly done on most other sites. If you deviate, your site will be harder to use and users will leave.