Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Input background to transparent on autocomplete form

Tags:

html

css

i wanted to set the background color to transparent to my input when the browser autocomplete my form, currently looks like the image added, anyone know how to accomplish this?

I've tried this but it set to white and the borders are style with the yellow default, i want the color for the text to be white too.

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px white inset;
}

This is how it looks:

enter image description here

Thanks in advance :)

like image 279
martinezjc Avatar asked Apr 11 '15 17:04

martinezjc


3 Answers

Finally i get the result with this piece of code:

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    transition: background-color 5000s ease-in-out 0s;
    -webkit-text-fill-color: #fff !important;
}
like image 68
martinezjc Avatar answered Oct 22 '22 11:10

martinezjc


use this to save your time

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
   -webkit-transition-delay: 9999s;
   transition-delay: 9999s;
}
like image 24
wahmal Avatar answered Oct 22 '22 09:10

wahmal


thanks martinezjc for the idea, but if we leave page opened for some time we will notice backround change

we can eliminate transition using css animation and forwards fill mode to make background color permanent

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-animation: autofill 0s forwards;
    animation: autofill 0s forwards;
}

@keyframes autofill {
    100% {
        background: transparent;
        color: inherit;
    }
}

@-webkit-keyframes autofill {
    100% {
        background: transparent;
        color: inherit;
    }
}

just replace transparent with your color

like image 20
ForceUser Avatar answered Oct 22 '22 11:10

ForceUser