Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling Webkit Form Input Shadow [duplicate]

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

Is there a way to disable the colored shadow generated by Webkit browsers when a form element receives focus? It's yellow in Chrome and blue in Safari, and gets in the way of any custom focus styles I try to implement.

like image 615
derekerdmann Avatar asked Mar 03 '10 16:03

derekerdmann


People also ask

How do I remove the black border from the input field?

Use the :focus pseudo-class with the "no-outline" class to style the form fields that are focused by the user. To have clear fields in your forms, set the outline property to its "none" value, which is used to display no outline.

How do I turn off focus input?

To remove the focus on an input tag element in HTML, you can use the blur() method on the element using JavaScript. This input tag will be already focussed when a user visits the website and we want to remove the focus when we click the button below it.

How do you remove an outline in CSS?

Using the CSS rule :focus { outline: none; } to remove an outline on an object causes the link or control to be focusable, but removes any visible indication of focus for keyboard users. Methods to remove it such as onfocus="blur()" result in keyboard users being unable to interact with the link or control.


2 Answers

Try this:

input:focus {
    outline: none;
}
like image 138
Crozin Avatar answered Oct 11 '22 20:10

Crozin


You can try outline: none but please note that this is generally not really desirable for usability reasons. Always keep Jakob Nielsen's "Law of the Web User Experience" in mind:

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.

like image 21
ЯegDwight Avatar answered Oct 11 '22 19:10

ЯegDwight