Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

outline:none is not working on input tags [duplicate]

Possible Duplicate:
How come I can't remove the blue textarea border in Twitter Bootstrap?

Every search I do to get rid of the highlight on input fields says to use the css:

input:focus {
    outline:none;
}

This is not working at all. I am using the latest version of chrome, firefox, and safari to test this out.

I am also using the Bootstrap css library, I am not sure if this would cause this kind of problem.

The effect I am trying to achieve is a blank line in a simulated console screen. I have it working and looking perfectly, except for the highlight when the inout field is in focus.

Any help would be greatly appreciated.

like image 706
KayoticSully Avatar asked Jun 23 '12 22:06

KayoticSully


People also ask

How do you focus none 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.

How do I get rid of default input focus border?

border:0; outline:none; box-shadow:none; This should do the trick.


2 Answers

The solution that is working for me

input, input:focus{
        position:absolute;
        width:auto;
        bottom:0px;
        padding:0px;
        margin:2px;
        background-color:#000000;
        color:#33FF00;
        border-width: 0px;
        outline:0; /* I have also tried outline:none */
        -webkit-appearance:none;
        box-shadow: none;
        -moz-box-shadow: none;
        -webkit-box-shadow: none;
}

Specifically the base css that fixes the problem:

input, input:focus{
        border-width: 0px;
        outline:0; /* I have also tried outline:none */
        -webkit-appearance:none;
        box-shadow: none;
        -moz-box-shadow: none;
        -webkit-box-shadow: none;
}

I had originally forgotten to set the box-shadow to none.

like image 57
KayoticSully Avatar answered Nov 15 '22 07:11

KayoticSully


If input{outline:none;} is not working, try:

input, input:focus{
  outline:0px !important;
  -webkit-appearance:none;
}
like image 22
baptme Avatar answered Nov 15 '22 05:11

baptme